{"action":"opened","issue":{"url":"https://api.github.com/repos/numba/numba/issues/1040","labels_url":"https://api.github.com/repos/numba/numba/issues/1040/labels{/name}","comments_url":"https://api.github.com/repos/numba/numba/issues/1040/comments","events_url":"https://api.github.com/repos/numba/numba/issues/1040/events","html_url":"https://github.com/numba/numba/issues/1040","id":62049533,"number":1040,"title":"Wrong type determination for the sum2d example","user":{"login":"rth","id":630936,"avatar_url":"https://avatars.githubusercontent.com/u/630936?v=3","gravatar_id":"","url":"https://api.github.com/users/rth","html_url":"https://github.com/rth","followers_url":"https://api.github.com/users/rth/followers","following_url":"https://api.github.com/users/rth/following{/other_user}","gists_url":"https://api.github.com/users/rth/gists{/gist_id}","starred_url":"https://api.github.com/users/rth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rth/subscriptions","organizations_url":"https://api.github.com/users/rth/orgs","repos_url":"https://api.github.com/users/rth/repos","events_url":"https://api.github.com/users/rth/events{/privacy}","received_events_url":"https://api.github.com/users/rth/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-16T11:23:07Z","updated_at":"2015-03-16T11:23:07Z","closed_at":null,"body":"I tried to run the `sum2d` example from the front page with numba, and I'm not getting any seep-up at all compared to pure python (see below).   The problem probably lies that `N`, `M` and `result` variables  types are determined as  `pyobject` instead of  `int` and `float` respectively.\r\n\r\nI am using Python 2.7, numpy 1.9.1, llvm 3.5.1, numba 0.17,  llvmlite 0.2.1  on Gentoo Linux.\r\n\r\n    Python QtConsole 3.0.0\r\n    Python 2.7.9 (default, Mar  3 2015, 17:03:10)\r\n    Type \"copyright\", \"credits\" or \"license\" for more information.\r\n\r\n    In [1]: from numba import jit\r\n       ...: import numpy as np\r\n       ...: \r\n       ...: x = np.random.randn(1000, 1000)\r\n       ...:\r\n       ...: def sum2d(arr):\r\n       ...:     M, N = arr.shape\r\n       ...:     result = 0.0\r\n       ...:     for i in arange(M):\r\n       ...:         for j in arange(N):\r\n       ...:             result += arr[i,j]\r\n       ...:     return result\r\n       ...:\r\n       ...: sum2d_numba = jit()(sum2d)\r\n\r\n\r\n    In [2]: %timeit sum2d(x)\r\n    1 loops, best of 3: 241 ms per loop\r\n\r\n    In [3]: %timeit sum2d_numba(x)\r\n    1 loops, best of 3: 306 ms per loop\r\n\r\n    In [4]: sum2d_numba.signatures\r\n    Out[4]: [(array(float64, 2d, C, nonconst),)]\r\n    In [5]: sum2d_numba.inspect_types()\r\n    http://pastebin.com/VWFTJ5t4\r\n  "}}