Casts a tf.Tensor to a new dtype.
tf.Tensor
const x = tf.tensor1d([1.5, 2.5, 3]);tf.cast(x, 'int32').print(); Copy
const x = tf.tensor1d([1.5, 2.5, 3]);tf.cast(x, 'int32').print();
The input tensor to be casted.
The dtype to cast the input tensor to.
Casts a
tf.Tensor
to a new dtype.