aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/client
diff options
context:
space:
mode:
authorGravatar Skye Wanderman-Milne <skyewm@google.com>2018-06-15 15:29:33 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-06-15 15:35:54 -0700
commit1d74a69443f741e69f9f52cb6bc2940b4d4ae3b7 (patch)
tree04ebebb6146abb1bd2ab128cc0731f935a82af84 /tensorflow/python/client
parentb8861afe21d8d654c2a726cabd82069faca04532 (diff)
Enable fetching shapes from the C API by default.
Prior this change, we were using the C API for everything except Tensor.shape calls, which returned the result from the original Python shape inference code. With this change, we use the C API in this case as well. The C API has better shape inference, so this has the effect of returning more precise shapes in some cases. This change can be disabled by setting the environment variable TF_C_API_GRAPH_CONSTRUCTION_SHAPES=0. However, this toggle will be removed altogether in the near future. This also fixes a bug in the SWIG that could cause large shape dimensions to be incorrect. PiperOrigin-RevId: 200783822
Diffstat (limited to 'tensorflow/python/client')
-rw-r--r--tensorflow/python/client/tf_session.i2
1 files changed, 1 insertions, 1 deletions
diff --git a/tensorflow/python/client/tf_session.i b/tensorflow/python/client/tf_session.i
index 1db1432d65..def730371d 100644
--- a/tensorflow/python/client/tf_session.i
+++ b/tensorflow/python/client/tf_session.i
@@ -610,7 +610,7 @@ def TF_Reset(target, containers=None, config=None):
}
for (size_t i = 0; i < $1.size(); ++i) {
- PyList_SET_ITEM($result, i, PyInt_FromLong($1[i]));
+ PyList_SET_ITEM($result, i, PyLong_FromLong($1[i]));
}
}