mlx.core.linalg.cross

目錄

mlx.core.linalg.cross#

cross(a: array, b: array, axis: int = -1, *, stream: None | Stream | Device = None) array#

Compute the cross product of two arrays along a specified axis.

The cross product is defined for arrays with size 2 or 3 in the specified axis. If the size is 2 then the third value is assumed to be zero.

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

  • b (array) -- Input array.

  • axis (int, optional) -- Axis along which to compute the cross product. Default: -1.

  • stream (Stream, optional) -- Stream or device. Defaults to None in which case the default stream of the default device is used.

回傳:

The cross product of a and b along the specified axis.

回傳型別:

array