mxnet.np.broadcast_to

broadcast_to(array, shape)

Broadcast an array to a new shape.

Parameters
  • array (ndarray or scalar) – The array to broadcast.

  • shape (tuple) – The shape of the desired array.

Returns

broadcast – A readonly view on the original array with the given shape. It is typically not contiguous. Furthermore, more than one element of a broadcasted array may refer to a single memory location.

Return type

array

Raises

MXNetError – If the array is not compatible with the new shape according to NumPy’s broadcasting rules.