mirror of
https://github.com/zebrajr/tensorflow.git
synced 2025-12-06 12:20:11 +01:00
Fast-path for EagerTensorBase.dtype
PiperOrigin-RevId: 170933005
This commit is contained in:
parent
08e266d9b5
commit
b925f8553c
|
|
@ -582,7 +582,9 @@ class _EagerTensorBase(Tensor):
|
|||
|
||||
@property
|
||||
def dtype(self):
|
||||
return dtypes.as_dtype(self._datatype_enum())
|
||||
# Note: using the intern table directly here as this is
|
||||
# performance-sensitive in some models.
|
||||
return dtypes._INTERN_TABLE[self._datatype_enum()] # pylint: disable=protected-access
|
||||
|
||||
def _numpy_text(self, is_repr=False):
|
||||
if self.dtype.is_numpy_compatible:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user