pymoose.reshape#

pymoose.reshape(x, shape, placement=None)[source]#

Reshape a tensor.

Broadcasting is not allowed; the new shape must have the same total number of elements.

Parameters
  • x – A tensor.

  • shape – A list, tuple, or Shape dictating the new shape of the tensor.

  • placement – An optional Placement to pin this operation to.

Returns

The reshaped tensor.