mlx.core.view

目錄

mlx.core.view#

view(a: scalar | array, dtype: Dtype, stream: None | Stream | Device = None) array#

View the array as a different type.

The output shape changes along the last axis if the input array's type and the input dtype do not have the same size.

Note: the view op does not imply that the input and output arrays share their underlying data. The view only gaurantees that the binary representation of each element (or group of elements) is the same.

參數:
  • a (array) -- Input array or scalar.

  • dtype (Dtype) -- The data type to change to.

回傳值:

The array with the new type.

回傳值型別:

array