megengine.functional.expand_dims# expand_dims(inp, axis)[source]# Adds dimension before given axis. Parameters: inp (Tensor) – input tensor. axis (Union[int, Sequence[int]]) – place of new axes. Return type: Tensor Returns: output tensor. Examples >>> import numpy as np >>> x = Tensor([1, 2]) >>> out = F.expand_dims(x, 0) >>> out.numpy().shape (1, 2)