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

Function to_bfloat16

tensorflow/python/ops/math_ops.py:821–835  ·  view source on GitHub ↗

Casts a tensor to type `bfloat16`. Args: x: A `Tensor` or `SparseTensor` or `IndexedSlices`. name: A name for the operation (optional). Returns: A `Tensor` or `SparseTensor` or `IndexedSlices` with same shape as `x` with type `bfloat16`. Raises: TypeError: If `x` cannot

(x, name="ToBFloat16")

Source from the content-addressed store, hash-verified

819@deprecation.deprecated(date=None, instructions="Use `tf.cast` instead.")
820@tf_export(v1=["to_bfloat16"])
821def to_bfloat16(x, name="ToBFloat16"):
822 """Casts a tensor to type `bfloat16`.
823
824 Args:
825 x: A `Tensor` or `SparseTensor` or `IndexedSlices`.
826 name: A name for the operation (optional).
827
828 Returns:
829 A `Tensor` or `SparseTensor` or `IndexedSlices` with same shape as `x` with
830 type `bfloat16`.
831
832 Raises:
833 TypeError: If `x` cannot be cast to the `bfloat16`.
834 """
835 return cast(x, dtypes.bfloat16, name=name)
836
837
838@deprecation.deprecated(date=None, instructions="Use `tf.cast` instead.")

Callers

nothing calls this directly

Calls 1

castFunction · 0.70

Tested by

no test coverage detected