{"action":"created","issue":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/1950","repository_url":"https://api.github.com/repos/tensorflow/tensorflow","labels_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/1950/labels{/name}","comments_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/1950/comments","events_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/1950/events","html_url":"https://github.com/tensorflow/tensorflow/issues/1950","id":148414558,"number":1950,"title":"tf.gather doesn't support SparseTensors as an input","user":{"login":"Remper","id":451747,"avatar_url":"https://avatars.githubusercontent.com/u/451747?v=3","gravatar_id":"","url":"https://api.github.com/users/Remper","html_url":"https://github.com/Remper","followers_url":"https://api.github.com/users/Remper/followers","following_url":"https://api.github.com/users/Remper/following{/other_user}","gists_url":"https://api.github.com/users/Remper/gists{/gist_id}","starred_url":"https://api.github.com/users/Remper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Remper/subscriptions","organizations_url":"https://api.github.com/users/Remper/orgs","repos_url":"https://api.github.com/users/Remper/repos","events_url":"https://api.github.com/users/Remper/events{/privacy}","received_events_url":"https://api.github.com/users/Remper/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/tensorflow/tensorflow/labels/awaiting%20googler","name":"awaiting googler","color":"b60205"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2016-04-14T16:23:01Z","updated_at":"2016-08-12T19:54:35Z","closed_at":"2016-08-12T19:54:35Z","body":"As the code in ```tf.nn.embedding_lookup``` suggests, there were attempts in 0.8 to make it accept SparseTensors, but then everything funnels into ```tf.gather``` that tries to convert SparseTensor to Tensor and fails.\r\n\r\nIs it a correct behaviour or is it a bug? If not, is there any workaround to achieve the same effect (get some of the rows of a SparseTensor based on a index list)? Otherwise, SparseTensors are close to being completely unusable.\r\n\r\n### Environment info\r\nOperating System: OS X 10.10.5\r\nTensorFlow version: 0.8.0rc0\r\n\r\n### Log:\r\n```\r\n  File \"/usr/local/lib/python2.7/site-packages/tensorflow/python/ops/gen_array_ops.py\", line 566, in gather\r\n    validate_indices=validate_indices, name=name)\r\n  File \"/usr/local/lib/python2.7/site-packages/tensorflow/python/ops/op_def_library.py\", line 411, in apply_op\r\n    as_ref=input_arg.is_ref)\r\n  File \"/usr/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py\", line 566, in convert_to_tensor\r\n    ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)\r\n  File \"/usr/local/lib/python2.7/site-packages/tensorflow/python/ops/constant_op.py\", line 179, in _constant_tensor_conversion_function\r\n    return constant(v, dtype=dtype, name=name)\r\n  File \"/usr/local/lib/python2.7/site-packages/tensorflow/python/ops/constant_op.py\", line 162, in constant\r\n    tensor_util.make_tensor_proto(value, dtype=dtype, shape=shape))\r\n  File \"/usr/local/lib/python2.7/site-packages/tensorflow/python/framework/tensor_util.py\", line 390, in make_tensor_proto\r\n    tensor_proto.string_val.extend([compat.as_bytes(x) for x in proto_values])\r\n  File \"/usr/local/lib/python2.7/site-packages/tensorflow/python/util/compat.py\", line 44, in as_bytes\r\n    raise TypeError('Expected binary or unicode string, got %r' % bytes_or_text)\r\nTypeError: Expected binary or unicode string, got <tensorflow.python.framework.ops.SparseTensor object at 0x103dbc350>\r\n```"},"comment":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/comments/239544486","html_url":"https://github.com/tensorflow/tensorflow/issues/1950#issuecomment-239544486","issue_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/1950","id":239544486,"user":{"login":"girving","id":70511,"avatar_url":"https://avatars.githubusercontent.com/u/70511?v=3","gravatar_id":"","url":"https://api.github.com/users/girving","html_url":"https://github.com/girving","followers_url":"https://api.github.com/users/girving/followers","following_url":"https://api.github.com/users/girving/following{/other_user}","gists_url":"https://api.github.com/users/girving/gists{/gist_id}","starred_url":"https://api.github.com/users/girving/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/girving/subscriptions","organizations_url":"https://api.github.com/users/girving/orgs","repos_url":"https://api.github.com/users/girving/repos","events_url":"https://api.github.com/users/girving/events{/privacy}","received_events_url":"https://api.github.com/users/girving/received_events","type":"User","site_admin":false},"created_at":"2016-08-12T19:54:35Z","updated_at":"2016-08-12T19:54:35Z","body":"Thanks @ysuematsu for commenting.  Let's close this for now, since I think efficient gather on sparse tensors is infeasible without quite a lot of work."}}
{"actor":{"display_login":"girving"}}