The `TensorShape` that represents the dense shape of this tensor.
(self)
| 57 | % self._type_spec) |
| 58 | |
| 59 | def get_shape(self): |
| 60 | """The `TensorShape` that represents the dense shape of this tensor.""" |
| 61 | if hasattr(self._type_spec, "shape"): |
| 62 | return self._type_spec.shape |
| 63 | elif hasattr(self._type_spec, "_shape"): |
| 64 | # Prior to TF version 2.3, RaggedTensor._shape was private. |
| 65 | return self._type_spec._shape # pylint: disable=protected-access |
| 66 | else: |
| 67 | raise ValueError("Expected TypeSpec %r to have a shape attribute" |
| 68 | % self._type_spec) |
| 69 | |
| 70 | @property |
| 71 | def is_sparse(self): |
no outgoing calls