-
Notifications
You must be signed in to change notification settings - Fork 52
Closed
Labels
QuestionGeneral question.General question.
Description
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]: import numpy as np
In [2]: a = np.empty((1, 2, 1, 3, 1, 4))
In [3]: a.squeeze().shape
Out[3]: (2, 3, 4)
In [4]: import torch
In [5]: torch.from_numpy(a).squeeze().shape
Out[5]: torch.Size([2, 3, 4])
Maybe we can add this to the spec?
Metadata
Metadata
Assignees
Labels
QuestionGeneral question.General question.