{"action":"created","issue":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/1702","repository_url":"https://api.github.com/repos/tensorflow/tensorflow","labels_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/1702/labels{/name}","comments_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/1702/comments","events_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/1702/events","html_url":"https://github.com/tensorflow/tensorflow/issues/1702","id":144416734,"number":1702,"title":"Print operation flattens the tensors","user":{"login":"pronobis","id":331795,"avatar_url":"https://avatars.githubusercontent.com/u/331795?v=3","gravatar_id":"","url":"https://api.github.com/users/pronobis","html_url":"https://github.com/pronobis","followers_url":"https://api.github.com/users/pronobis/followers","following_url":"https://api.github.com/users/pronobis/following{/other_user}","gists_url":"https://api.github.com/users/pronobis/gists{/gist_id}","starred_url":"https://api.github.com/users/pronobis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pronobis/subscriptions","organizations_url":"https://api.github.com/users/pronobis/orgs","repos_url":"https://api.github.com/users/pronobis/repos","events_url":"https://api.github.com/users/pronobis/events{/privacy}","received_events_url":"https://api.github.com/users/pronobis/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/tensorflow/tensorflow/labels/contributions%20welcome","name":"contributions welcome","color":"009800"},{"url":"https://api.github.com/repos/tensorflow/tensorflow/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-03-29T23:20:21Z","updated_at":"2016-10-09T02:13:11Z","closed_at":null,"body":"### Environment info\r\nOperating System: Linux\r\nUsing: pip, 0.7.1 for Python 3\r\n\r\n### Steps to reproduce\r\nRun:\r\n\r\n```\r\na=tf.constant([[1], [2]])\r\nb=tf.Print(a, [a])\r\n```\r\n\r\n### Output\r\n```\r\nI tensorflow/core/kernels/logging_ops.cc:79] [1 2]\r\n```\r\nwhile the tensor evalutes to:\r\n```\r\narray([[1],\r\n       [2]], dtype=int32)\r\n```\r\n\r\n### Expected output\r\n```\r\nI tensorflow/core/kernels/logging_ops.cc:79] [[1], [2]]\r\n```"},"comment":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/comments/252459726","html_url":"https://github.com/tensorflow/tensorflow/issues/1702#issuecomment-252459726","issue_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/1702","id":252459726,"user":{"login":"zffchen78","id":7943790,"avatar_url":"https://avatars.githubusercontent.com/u/7943790?v=3","gravatar_id":"","url":"https://api.github.com/users/zffchen78","html_url":"https://github.com/zffchen78","followers_url":"https://api.github.com/users/zffchen78/followers","following_url":"https://api.github.com/users/zffchen78/following{/other_user}","gists_url":"https://api.github.com/users/zffchen78/gists{/gist_id}","starred_url":"https://api.github.com/users/zffchen78/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zffchen78/subscriptions","organizations_url":"https://api.github.com/users/zffchen78/orgs","repos_url":"https://api.github.com/users/zffchen78/repos","events_url":"https://api.github.com/users/zffchen78/events{/privacy}","received_events_url":"https://api.github.com/users/zffchen78/received_events","type":"User","site_admin":false},"created_at":"2016-10-09T02:13:11Z","updated_at":"2016-10-09T02:13:11Z","body":"This might be easier. tf.Print was created before we have convenient ways to calling python runtime:\r\n\r\n`\r\ndef Print(inp, data):\r\n  def np_print(*args):\r\n    for x in args:\r\n      print(x)\r\n  return tf.with_dependencies([tf.py_func(np_print, data, [])], inp)\r\n\r\ng = tf.Graph()\r\nwith g.as_default():\r\n  x = tf.random_uniform([2, 2])\r\n  y = tf.random_uniform([2, 2])\r\n  z = tf.random_uniform([2, 2])\r\n  x = Print(x, [x, y, z])\r\n\r\nwith tf.Session(graph=g) as sess:\r\n  x.eval()\r\n`"}}
{"actor":{"display_login":"zffchen78"}}