mlx.core.array.astype

mlx.core.array.astype#

array.astype(self, dtype: Dtype, stream: Optional[Union[Stream, Device]] = None) array#

将数组转换为指定的类型。

参数:
  • dtype (Dtype) – 数组要转换的类型。

  • stream (Stream) – 操作使用的流(或设备)。

返回:

类型为 dtype 的数组。

返回类型:

array