cupy.linalg.cross#
- cupy.linalg.cross(x1, x2, /, *, axis=-1)[source]#
Returns the cross product of 3-element vectors.
If
x1
and/orx2
are multi-dimensional arrays, then the cross-product of each pair of corresponding 3-element vectors is independently computed.This function is Array API compatible, contrary to
cupy.cross()
.- Parameters:
x1 (ndarray) – The first input array.
x2 (array_like) – The second input array. Must be compatible with
x1
for all non-compute axes. The size of the axis over which to compute the cross-product must be the same size as the respective axis inx1
.axis (int, optional) – The axis (dimension) of
x1
andx2
containing the vectors for which to compute the cross-product. Default:-1
.
- Returns:
out – An array containing the cross products.
- Return type:
See also