Home | History | Annotate | Download | only in ops

Lines Matching defs:cast

744 @tf_export("cast")
745 def cast(x, dtype, name=None):
755 tf.cast(x, tf.int32) # [1, 2], dtype=tf.int32
767 TypeError: If `x` cannot be cast to the `dtype`.
770 with ops.name_scope(name, "Cast", [x]) as name:
772 values_cast = cast(x.values, base_type, name=name)
777 # allows some conversions that cast() can't do, e.g. casting numbers to
782 return gen_math_ops.cast(x, base_type, name=name)
787 """Performs a safe saturating cast of `value` to `dtype`.
790 there is a danger that values would over or underflow in the cast, this op
791 applies the appropriate clamping before the cast.
799 `value` safely cast to `dtype`.
816 return cast(value, dtype, name=name)
831 TypeError: If `x` cannot be cast to the `float32`.
833 return cast(x, dtypes.float32, name=name)
848 TypeError: If `x` cannot be cast to the `float64`.
850 return cast(x, dtypes.float64, name=name)
865 TypeError: If `x` cannot be cast to the `int32`.
867 return cast(x, dtypes.int32, name=name)
882 TypeError: If `x` cannot be cast to the `int64`.
884 return cast(x, dtypes.int64, name=name)
899 TypeError: If `x` cannot be cast to the `bfloat16`.
901 return cast(x, dtypes.bfloat16, name=name)
1011 sp_values = cast(sp_values, dtype)
1012 y = cast(y, dtype)
1031 x = cast(x, dtype)
1032 y = cast(y, dtype)
1069 arguments are cast to floating types first. This op is generated by normal
1076 inputs are cast to `float32` for `int8` and `int16` and `float64` for `int32`
1279 start = cast(start, inferred_dtype)
1280 limit = cast(limit, inferred_dtype)
1281 delta = cast(delta, inferred_dtype)
1436 return cast(
2063 ret = cast(ret, dtypes.bfloat16)
2143 ops.IndexedSlices(o.values, cast(o.indices, dtypes.int64),
2359 output_size = cast(array_is_nonempty, dtypes.int32) * (reduce_max(arr) + 1)
2540 # cast needed for SparseTensor reductions
2891 axes = cast(axes >= 0, dtypes.int32) * axes + cast(