Creates rank-1 tf.Tensor with the provided values, shape and dtype.
tf.Tensor
The same functionality can be achieved with tf.tensor, but in general we recommend using tf.tensor1d as it makes the code more readable.
tf.tensor
tf.tensor1d
tf.tensor1d([1, 2, 3]).print(); Copy
tf.tensor1d([1, 2, 3]).print();
The values of the tensor. Can be array of numbers, or a TypedArray.
TypedArray
Optional
The data type.
Creates rank-1
tf.Tensor
with the provided values, shape and dtype.The same functionality can be achieved with
tf.tensor
, but in general we recommend usingtf.tensor1d
as it makes the code more readable.