diff options
author | Skye Wanderman-Milne <skyewm@google.com> | 2018-04-05 18:21:54 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-04-05 18:24:30 -0700 |
commit | 9fc9f19428e497f3a297538059804f69996a612e (patch) | |
tree | 0963442fb575b9ef6375dbd586afecbc1d0806fe /tensorflow/python/client | |
parent | c5aa11eb33542422889398c71fc61cf01a3cc5ca (diff) |
Lazily evaluate shapes with the C API enabled.
This change makes it so shapes are computed only when requested with
_USE_C_API = True. Note that the C API will still raise a shape error
if necessary when the op is created.
In addition, it cleans up the logic for _USE_C_SHAPES = True. In this
case, we lazily fetch and cache shapes directly from the C API. We no
longer need set_shapes_for_outputs at all in this case.
PiperOrigin-RevId: 191830565
Diffstat (limited to 'tensorflow/python/client')
-rw-r--r-- | tensorflow/python/client/tf_session_helper.cc | 9 | ||||
-rw-r--r-- | tensorflow/python/client/tf_session_helper.h | 7 |
2 files changed, 0 insertions, 16 deletions
diff --git a/tensorflow/python/client/tf_session_helper.cc b/tensorflow/python/client/tf_session_helper.cc index b48d758e4a..b6481e7e29 100644 --- a/tensorflow/python/client/tf_session_helper.cc +++ b/tensorflow/python/client/tf_session_helper.cc @@ -629,15 +629,6 @@ void TF_GraphSetTensorShape_wrapper(TF_Graph* graph, TF_Output output, TF_GraphSetTensorShape(graph, output, dims.data(), dims.size(), status); } -std::vector<int64_t> TF_GraphGetTensorShape_wrapper(TF_Graph* graph, - TF_Output output, - int num_dims, - TF_Status* status) { - std::vector<int64_t> dims(num_dims); - TF_GraphGetTensorShape(graph, output, dims.data(), num_dims, status); - return dims; -} - std::vector<string> TF_ImportGraphDefResultsMissingUnusedInputMappings_wrapper( TF_ImportGraphDefResults* results) { int num_missing_unused_input_mappings; diff --git a/tensorflow/python/client/tf_session_helper.h b/tensorflow/python/client/tf_session_helper.h index d2b4abc476..cfd27c2bee 100644 --- a/tensorflow/python/client/tf_session_helper.h +++ b/tensorflow/python/client/tf_session_helper.h @@ -229,13 +229,6 @@ void TF_GraphSetTensorShape_wrapper(TF_Graph* graph, TF_Output output, const std::vector<int64_t>& dims, bool unknown_shape, TF_Status* status); -// Return the shape of output. `num_dims` should be the output of -// TF_GraphGetTensorNumDims. If `num_dims = -1`, this should not be called. -std::vector<int64_t> TF_GraphGetTensorShape_wrapper(TF_Graph* graph, - TF_Output output, - int num_dims, - TF_Status* status); - // Returns the string representations of the missing unused input mappings. std::vector<string> TF_ImportGraphDefResultsMissingUnusedInputMappings_wrapper( TF_ImportGraphDefResults* results); |