{"action":"created","issue":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/19498","repository_url":"https://api.github.com/repos/tensorflow/tensorflow","labels_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/19498/labels{/name}","comments_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/19498/comments","events_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/19498/events","html_url":"https://github.com/tensorflow/tensorflow/issues/19498","id":325669166,"number":19498,"title":"tf.reduce_sum not consistent with documentation when axis==[ ]","user":{"login":"tdanyluk","id":9149812,"avatar_url":"https://avatars1.githubusercontent.com/u/9149812?v=4","gravatar_id":"","url":"https://api.github.com/users/tdanyluk","html_url":"https://github.com/tdanyluk","followers_url":"https://api.github.com/users/tdanyluk/followers","following_url":"https://api.github.com/users/tdanyluk/following{/other_user}","gists_url":"https://api.github.com/users/tdanyluk/gists{/gist_id}","starred_url":"https://api.github.com/users/tdanyluk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tdanyluk/subscriptions","organizations_url":"https://api.github.com/users/tdanyluk/orgs","repos_url":"https://api.github.com/users/tdanyluk/repos","events_url":"https://api.github.com/users/tdanyluk/events{/privacy}","received_events_url":"https://api.github.com/users/tdanyluk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-23T11:46:55Z","updated_at":"2018-05-23T21:05:40Z","closed_at":null,"author_association":"NONE","body":"### System information\r\n- **Have I written custom code (as opposed to using a stock example script provided in TensorFlow)**: yes\r\n- **OS Platform and Distribution (e.g., Linux Ubuntu 16.04)**:  Linux Ubuntu 16.04\r\n- **TensorFlow installed from (source or binary)**: binary\r\n- **TensorFlow version (use command below)**: 1.7.0\r\n- **Python version**:  3.5.2\r\n- **Bazel version (if compiling from source)**:\r\n- **GCC/Compiler version (if compiling from source)**:\r\n- **CUDA/cuDNN version**:  9.0.176 / 7.0.5\r\n- **GPU model and memory**: GeForce GTX 1050 Ti/PCIe/SSE2 4GB\r\n- **Exact command to reproduce**: custom script\r\n\r\n### Describe the problem\r\ndocumentation says:\r\nIf axis has no entries, all dimensions are reduced, and a tensor with a single element is returned.\r\n\r\nIn practice:\r\nIf axis == []: nothing is reduced (the output is the input itself)\r\n\r\n### Source code / logs\r\nimport tensorflow as tf\r\n\r\nconstant = tf.constant([[1., 2.], [3., 4.]])\r\nreduce = tf.reduce_sum(constant, axis=[])\r\n\r\nwith tf.Session() as sess:\r\n    print(sess.run(reduce))"},"comment":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/comments/391496140","html_url":"https://github.com/tensorflow/tensorflow/issues/19498#issuecomment-391496140","issue_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/19498","id":391496140,"user":{"login":"yongtang","id":6932348,"avatar_url":"https://avatars0.githubusercontent.com/u/6932348?v=4","gravatar_id":"","url":"https://api.github.com/users/yongtang","html_url":"https://github.com/yongtang","followers_url":"https://api.github.com/users/yongtang/followers","following_url":"https://api.github.com/users/yongtang/following{/other_user}","gists_url":"https://api.github.com/users/yongtang/gists{/gist_id}","starred_url":"https://api.github.com/users/yongtang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yongtang/subscriptions","organizations_url":"https://api.github.com/users/yongtang/orgs","repos_url":"https://api.github.com/users/yongtang/repos","events_url":"https://api.github.com/users/yongtang/events{/privacy}","received_events_url":"https://api.github.com/users/yongtang/received_events","type":"User","site_admin":false},"created_at":"2018-05-23T21:05:40Z","updated_at":"2018-05-23T21:05:40Z","author_association":"MEMBER","body":"The current behavior of tensorflow matches numpy:\r\n```\r\n# python\r\nPython 2.7.12 (default, Dec  4 2017, 14:50:18) \r\n[GCC 5.4.0 20160609] on linux2\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> import numpy as np\r\n>>> x = np.asarray([[1., 2.], [3., 4.]])\r\n>>> np.sum(x, ())\r\narray([[1., 2.],\r\n       [3., 4.]])\r\n>>> \r\n```\r\n\r\nSo I think this is a documentation (not implementation) issue. Created a PR #19509 for the documentation fix."}}
{"actor":{"display_login":"yongtang"}}