You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the only valid inputs for the axis parameter of xp.squeeze() are an int or a tuple of them.
Both numpy and PyTorch (I have not looked at the other libraries) support calling squeeze without the axis parameter. In this case all singleton dimensions will be squeezed:
In [1]: importnumpyasnpIn [2]: a=np.empty((1, 2, 1, 3, 1, 4))
In [3]: a.squeeze().shapeOut[3]: (2, 3, 4)
In [4]: importtorchIn [5]: torch.from_numpy(a).squeeze().shapeOut[5]: torch.Size([2, 3, 4])
Maybe we can add this to the spec?
The text was updated successfully, but these errors were encountered:
Currently the only valid inputs for the
axis
parameter ofxp.squeeze()
are anint
or a tuple of them.Both
numpy
andPyTorch
(I have not looked at the other libraries) support callingsqueeze
without theaxis
parameter. In this case all singleton dimensions will be squeezed:Maybe we can add this to the spec?
The text was updated successfully, but these errors were encountered: