{"action":"opened","issue":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/23641","repository_url":"https://api.github.com/repos/tensorflow/tensorflow","labels_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/23641/labels{/name}","comments_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/23641/comments","events_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/23641/events","html_url":"https://github.com/tensorflow/tensorflow/issues/23641","id":379373526,"node_id":"MDU6SXNzdWUzNzkzNzM1MjY=","number":23641,"title":"Calculation precision issue ","user":{"login":"liuyanpunk","id":7599397,"node_id":"MDQ6VXNlcjc1OTkzOTc=","avatar_url":"https://avatars1.githubusercontent.com/u/7599397?v=4","gravatar_id":"","url":"https://api.github.com/users/liuyanpunk","html_url":"https://github.com/liuyanpunk","followers_url":"https://api.github.com/users/liuyanpunk/followers","following_url":"https://api.github.com/users/liuyanpunk/following{/other_user}","gists_url":"https://api.github.com/users/liuyanpunk/gists{/gist_id}","starred_url":"https://api.github.com/users/liuyanpunk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liuyanpunk/subscriptions","organizations_url":"https://api.github.com/users/liuyanpunk/orgs","repos_url":"https://api.github.com/users/liuyanpunk/repos","events_url":"https://api.github.com/users/liuyanpunk/events{/privacy}","received_events_url":"https://api.github.com/users/liuyanpunk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-10T01:13:54Z","updated_at":"2018-11-10T01:13:54Z","closed_at":null,"author_association":"NONE","body":"<em>Please make sure that this is a bug. As per our [GitHub Policy](https://github.com/tensorflow/tensorflow/blob/master/ISSUES.md), we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template</em>\r\n\r\n**System information**\r\n- Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No\r\n- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Windows with Tensorflow Docker \r\n- Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:no\r\n- TensorFlow installed from (source or binary):binary\r\n- TensorFlow version (use command below):1.12\r\n- Python version:2.7\r\n- Bazel version (if compiling from source):na\r\n- GCC/Compiler version (if compiling from source):na\r\n- CUDA/cuDNN version:9, 7.3.1\r\n- GPU model and memory:2080,8G \r\n\r\n\r\nYou can collect some of this information using our environment capture [script](https://github.com/tensorflow/tensorflow/tree/master/tools/tf_env_collect.sh)\r\nYou can also obtain the TensorFlow version with\r\npython -c \"import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)\"\r\n\r\n**Describe the current behavior**\r\nimport tensorflow as tf\r\n\r\ndef compute_area(sides):\r\n  a = sides[:,0]  # 5.0, 2.3\r\n  b = sides[:,1]  # 3.0, 4.1\r\n  c = sides[:,2]  # 7.1, 4.8\r\n  \r\n  s = (a + b + c) * 0.5   # (a + b) is a short-cut to tf.add(a, b)\r\n  areasq = s * (s - a) * (s - b) * (s - c) # (a * b) is a short-cut to tf.multiply(a, b), not tf.matmul(a, b)\r\n  return tf.sqrt(areasq)\r\n\r\nwith tf.Session() as sess:\r\n  area = compute_area(tf.constant([\r\n      [3.000000001, 4.0, 5.0],\r\n    ],dtype='float64'))\r\n  result = sess.run(area)\r\n  print(result)  \r\n\r\n[6.]\r\n\r\n**Describe the expected behavior**\r\nimport numpy as np\r\n\r\ns = (3.000000001 + 4 + 5) * 0.5\r\nareasq = s * (s - 3.000000001) * (s - 4) * (s - 5)\r\n\r\nprint(np.sqrt(areasq))\r\n\r\n6.000000001999999\r\n\r\n**Code to reproduce the issue**\r\nProvide a reproducible test case that is the bare minimum necessary to generate the problem.\r\nAttached as above \r\n\r\n**Other info / logs**\r\nInclude any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.\r\n\r\nN/A \r\n"}}
{"actor":{"display_login":"liuyanpunk"}}