diff options
Diffstat (limited to 'tensorflow/python/framework/dtypes.py')
-rw-r--r-- | tensorflow/python/framework/dtypes.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tensorflow/python/framework/dtypes.py b/tensorflow/python/framework/dtypes.py index a91223749d..78a77d38ed 100644 --- a/tensorflow/python/framework/dtypes.py +++ b/tensorflow/python/framework/dtypes.py @@ -59,6 +59,7 @@ class DType(object): @@name @@base_dtype @@real_dtype + @@is_bool @@is_floating @@is_complex @@is_integer @@ -142,6 +143,11 @@ class DType(object): return self._type_enum @property + def is_bool(self): + """Returns whether this is a boolean data type""" + return self.base_dtype == bool + + @property def is_integer(self): """Returns whether this is a (non-quantized) integer type.""" return (self.is_numpy_compatible and not self.is_quantized and |