squeezingShape()
Removes all dimensions of size 1 from the shape of the tensor.
Declaration
func squeezingShape() -> MLTensorDiscussion
For example:
let x = MLTensor(shape: [1, 2, 1], scalars: [1, 2], scalarType: Float.self)
let y = x.squeezingShape()
y.shape // is [2]