MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _c_api_shape

Method _c_api_shape

tensorflow/python/framework/ops.py:488–497  ·  view source on GitHub ↗

Returns the TensorShape of this tensor according to the C API.

(self)

Source from the content-addressed store, hash-verified

486 return result
487
488 def _c_api_shape(self):
489 """Returns the TensorShape of this tensor according to the C API."""
490 c_graph = self._op._graph._c_graph # pylint: disable=protected-access
491 shape_vector, unknown_shape = c_api.TF_GraphGetTensorShapeHelper(
492 c_graph, self._as_tf_output())
493 if unknown_shape:
494 return tensor_shape.unknown_shape()
495 else:
496 shape_vector = [None if d == -1 else d for d in shape_vector]
497 return tensor_shape.TensorShape(shape_vector)
498
499 @property
500 def _shape(self):

Callers 1

shapeMethod · 0.95

Calls 2

_as_tf_outputMethod · 0.95
unknown_shapeMethod · 0.80

Tested by

no test coverage detected