模型开发接口
推理部署接口
API 相关说明
Removes dimension of shape 1.
inp (Tensor) – input tensor.
Tensor
axis (Union[int, Sequence[int], None]) – place of axis to be removed.
Union
int
Sequence
None
output tensor.
Examples
>>> import numpy as np >>> x = Tensor(np.array([1, 2], dtype=np.int32).reshape(1, 1, 2, 1)) >>> out = F.squeeze(x, 3) >>> out.numpy().shape (1, 1, 2)
previous
megengine.functional.expand_dims
next
megengine.functional.concat