mlx.core.full

目录

mlx.core.full#

full(shape: int | Sequence[int], vals: scalar | array, dtype: Dtype | None = None, *, stream: None | Stream | Device = None) array#

构造一个填充给定值的数组。

构造一个形状为 shape,填充 vals 的数组。如果 vals 是一个 array,它必须可以广播到给定的 shape

参数:
  • shape (intlist(int)) – 输出数组的形状。

  • vals (floatintarray) – 用于填充数组的值。

  • dtype (Dtype, 可选) – 输出数组的数据类型。如果未指定,输出类型将从 vals 推断。

返回:

具有指定形状和值的输出数组。

返回类型:

array