torch.Tensor.Tensor.squeeze_
Tensor.squeeze_(): thisTensor.squeeze_(options: SqueezeOptions): thisRemoves all dimensions of size 1 from the tensor shape in-place.
Returns
this– This tensor with the squeezed shapeExamples
const x = torch.zeros(1, 3, 1, 4);
x.squeeze_(); // Now shape is [3, 4]