ivy.expand_dims(x, axis, f=None)[source]

Expands the shape of an array. Inserts a new axis that will appear at the axis position in the expanded array shape.

  • x (array) – Input array.

  • axis (int) – Position in the expanded axes where the new axis is placed.

  • f (ml_framework, optional) – Machine learning framework. Inferred from inputs if None.


array with the number of dimensions increased by onearray

Supported Frameworks:

empty jax_logo empty tf_logo empty pytorch_logo empty mxnet_logo empty numpy_logo empty