cupy.linalg.tensorinv#
- cupy.linalg.tensorinv(a, ind=2)[source]#
Computes the inverse of a tensor.
This function computes tensor
a_inv
from tensora
such thattensordot(a_inv, a, ind) == I
, whereI
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 oftensordot
.
- Returns:
The inverse of a tensor whose shape is equivalent to
a.shape[ind:] + a.shape[:ind]
.- Return type:
Warning
This function calls one or more cuSOLVER routine(s) which may yield invalid results if input conditions are not met. To detect these invalid results, you can set the linalg configuration to a value that is not ignore in
cupyx.errstate()
orcupyx.seterr()
.See also