mlx.core.asarray

目錄

mlx.core.asarray#

asarray(a: scalar | array | Sequence, dtype: Dtype | None = None, *, copy: bool | None = None) array#

Convert the input to an array.

參數:
  • a -- Input data.

  • dtype (Dtype, optional) -- The desired data-type for the array.

  • copy (bool, optional) -- Must be True or unspecified. False is not supported, since MLX has no in-place operations and cannot return a non-copying view.

回傳值:

An array interpretation of the input.

回傳值型別:

array

引發:

ValueError -- If copy is False.