cupy.linalg.tensorinv

cupy.linalg.tensorinv(a, ind=2)[source]

Computes the inverse of a tensor.

This function computes tensor a_inv from tensor a such that tensordot(a_inv, a, ind) == I, where I denotes the identity tensor.

Parameters:
  • a (cupy.ndarray) – The tensor such that prod(a.shape[:ind]) == prod(a.shape[ind:]).
  • ind (int) – The positive number used in axes option of tensordot.
Returns:

The inverse of a tensor whose shape is equivalent to a.shape[ind:] + a.shape[:ind].

Return type:

cupy.ndarray