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