Removes dimensions of size 1 from the shape of a tf.Tensor.
tf.Tensor
const x = tf.tensor([1, 2, 3, 4], [1, 1, 4]);x.squeeze().print(); Copy
const x = tf.tensor([1, 2, 3, 4], [1, 1, 4]);x.squeeze().print();
The input tensor to be squeezed.
Optional
An optional list of numbers. If specified, only squeezes the dimensions listed. The dimension index starts at 0. It is an error to squeeze a dimension that is not 1.
Generated using TypeDoc
Removes dimensions of size 1 from the shape of a
tf.Tensor
.