Returns the TensorShape of this tensor according to the C API.
(self)
| 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): |
no test coverage detected