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

Function is_numeric_tensor

tensorflow/python/ops/check_ops.py:1876–1896  ·  view source on GitHub ↗

Returns `True` if the elements of `tensor` are numbers. Specifically, returns `True` if the dtype of `tensor` is one of the following: * `tf.float32` * `tf.float64` * `tf.int8` * `tf.int16` * `tf.int32` * `tf.int64` * `tf.uint8` * `tf.qint8` * `tf.qint32` * `tf.quint8` * `t

(tensor)

Source from the content-addressed store, hash-verified

1874 v1=['debugging.is_numeric_tensor', 'is_numeric_tensor'])
1875@deprecation.deprecated_endpoints('is_numeric_tensor')
1876def is_numeric_tensor(tensor):
1877 """Returns `True` if the elements of `tensor` are numbers.
1878
1879 Specifically, returns `True` if the dtype of `tensor` is one of the following:
1880
1881 * `tf.float32`
1882 * `tf.float64`
1883 * `tf.int8`
1884 * `tf.int16`
1885 * `tf.int32`
1886 * `tf.int64`
1887 * `tf.uint8`
1888 * `tf.qint8`
1889 * `tf.qint32`
1890 * `tf.quint8`
1891 * `tf.complex64`
1892
1893 Returns `False` if `tensor` is of a non-numeric type or if `tensor` is not
1894 a `tf.Tensor` object.
1895 """
1896 return isinstance(tensor, ops.Tensor) and tensor.dtype in NUMERIC_TYPES
1897
1898
1899@tf_export(

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected