ivy.get_num_dims(x: Union[ivy.Array, ivy.NativeArray], as_array: bool = False, f: Optional[ivy.Framework] = None) → int[source]

Returns the number of dimensions of the array x.

  • x (array) – Input array to infer the number of dimensions for.

  • as_array (bool, optional) – Whether to return the shape as a array, default False.

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


Shape of the array

Supported Frameworks:

empty jax_logo empty tf_logo empty pytorch_logo empty mxnet_logo empty numpy_logo empty