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

Function to_float

tensorflow/python/ops/math_ops.py:745–759  ·  view source on GitHub ↗

Casts a tensor to type `float32`. 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 `float32`. Raises: TypeError: If `x` cannot be

(x, name="ToFloat")

Source from the content-addressed store, hash-verified

743@deprecation.deprecated(date=None, instructions="Use `tf.cast` instead.")
744@tf_export(v1=["to_float"])
745def to_float(x, name="ToFloat"):
746 """Casts a tensor to type `float32`.
747
748 Args:
749 x: A `Tensor` or `SparseTensor` or `IndexedSlices`.
750 name: A name for the operation (optional).
751
752 Returns:
753 A `Tensor` or `SparseTensor` or `IndexedSlices` with same shape as `x` with
754 type `float32`.
755
756 Raises:
757 TypeError: If `x` cannot be cast to the `float32`.
758 """
759 return cast(x, dtypes.float32, name=name)
760
761
762@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