模型开发接口
推理部署接口
API 相关说明
Adds dimension before given axis.
inp (Tensor) – input tensor.
Tensor
axis (Union[int, Sequence[int]]) – place of new axes.
Union
int
Sequence
output tensor.
Examples
>>> import numpy as np >>> x = Tensor([1, 2]) >>> out = F.expand_dims(x, 0) >>> out.numpy().shape (1, 2)
previous
megengine.functional.broadcast_to
next
megengine.functional.squeeze