{"action":"opened","issue":{"url":"https://api.github.com/repos/pfnet/chainer/issues/139","labels_url":"https://api.github.com/repos/pfnet/chainer/issues/139/labels{/name}","comments_url":"https://api.github.com/repos/pfnet/chainer/issues/139/comments","events_url":"https://api.github.com/repos/pfnet/chainer/issues/139/events","html_url":"https://github.com/pfnet/chainer/issues/139","id":93176717,"number":139,"title":"Curse of float64","user":{"login":"unnonouno","id":740680,"avatar_url":"https://avatars.githubusercontent.com/u/740680?v=3","gravatar_id":"","url":"https://api.github.com/users/unnonouno","html_url":"https://github.com/unnonouno","followers_url":"https://api.github.com/users/unnonouno/followers","following_url":"https://api.github.com/users/unnonouno/following{/other_user}","gists_url":"https://api.github.com/users/unnonouno/gists{/gist_id}","starred_url":"https://api.github.com/users/unnonouno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unnonouno/subscriptions","organizations_url":"https://api.github.com/users/unnonouno/orgs","repos_url":"https://api.github.com/users/unnonouno/repos","events_url":"https://api.github.com/users/unnonouno/events{/privacy}","received_events_url":"https://api.github.com/users/unnonouno/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-06T03:15:40Z","updated_at":"2015-07-06T03:15:40Z","closed_at":null,"body":"Adding `int` to 0-dim array causes a `float64` value.\r\n\r\n```\r\n>>> (numpy.array(1, numpy.float32) + 1).dtype\r\ndtype('float64')\r\n```\r\n\r\nWhen its dimension is greater than 0, this problem isn't happen.\r\n```\r\n>>> (numpy.array([1], numpy.float32) + 1).dtype\r\ndtype('float32’)\r\n```\r\n\r\nOnly functions in `basic_math` accept 0-dim array as an input value.\r\nThese functions only forward input data to numpy, and it may causes `float64` problem.\r\n\r\nWe need to check types of arguments and when they contains `float32` and standard python types like `int` or `float`, we need to convert results to `float32` as results of calculation are `float64`."}}