{"action":"opened","issue":{"url":"https://api.github.com/repos/NervanaSystems/neon/issues/170","labels_url":"https://api.github.com/repos/NervanaSystems/neon/issues/170/labels{/name}","comments_url":"https://api.github.com/repos/NervanaSystems/neon/issues/170/comments","events_url":"https://api.github.com/repos/NervanaSystems/neon/issues/170/events","html_url":"https://github.com/NervanaSystems/neon/issues/170","id":123138925,"number":170,"title":"Incorrect AutoDiff for some expressions with \"max\" ?","user":{"login":"oleg-trott","id":2914939,"avatar_url":"https://avatars.githubusercontent.com/u/2914939?v=3","gravatar_id":"","url":"https://api.github.com/users/oleg-trott","html_url":"https://github.com/oleg-trott","followers_url":"https://api.github.com/users/oleg-trott/followers","following_url":"https://api.github.com/users/oleg-trott/following{/other_user}","gists_url":"https://api.github.com/users/oleg-trott/gists{/gist_id}","starred_url":"https://api.github.com/users/oleg-trott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oleg-trott/subscriptions","organizations_url":"https://api.github.com/users/oleg-trott/orgs","repos_url":"https://api.github.com/users/oleg-trott/repos","events_url":"https://api.github.com/users/oleg-trott/events{/privacy}","received_events_url":"https://api.github.com/users/oleg-trott/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-20T07:00:16Z","updated_at":"2015-12-20T07:00:16Z","closed_at":null,"body":"The last result apparently violates the linearity of the gradient operator (as it should be the sum of the previous two)\r\n\r\n    In [352]: neon.__version__\r\n    Out[352]: '1.1.3'\r\n    \r\n    In [353]: x = ng.array(np.array([[2, 3]]))\r\n    \r\n    In [354]: Autodiff(op_tree=(0+x), be=ng, next_error=ng.ones(x.shape)).get_grad_asnumpyarray([x])\r\n    Out[354]: [array([[ 1.,  1.]], dtype=float32)]\r\n    \r\n    In [355]: Autodiff(op_tree=ng.max(x), be=ng, next_error=ng.ones(x.shape)).get_grad_asnumpyarray([x])\r\n    Out[355]: [array([[ 0.,  1.]], dtype=float32)]\r\n    \r\n    In [356]: Autodiff(op_tree=(ng.max(x) + x), be=ng, next_error=ng.ones(x.shape)).get_grad_asnumpyarray([x])\r\n    Out[356]: [array([[ 1.,  3.]], dtype=float32)]\r\n"}}