ivy.reshape(x, newshape, f=None)[source]

Gives a new shape to an array without changing its data.

  • x (array) – Tensor to be reshaped.

  • newshape (sequence of ints) – The new shape should be compatible with the original shape. One shape dimension can be -1. In this case, the value is inferred from the length of the array and remaining dimensions.

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


Reshaped array.

Supported Frameworks:

empty jax_logo empty tf_logo empty pytorch_logo empty mxnet_logo empty numpy_logo empty