jax.numpy.linalg.tensorinv#
- jax.numpy.linalg.tensorinv(a, ind=2)[source]#
Compute the âinverseâ of an N-dimensional array.
LAX-backend implementation of
numpy.linalg.tensorinv()
.Original docstring below.
The result is an inverse for a relative to the tensordot operation
tensordot(a, b, ind)
, i. e., up to floating-point accuracy,tensordot(tensorinv(a), a, ind)
is the âidentityâ tensor for the tensordot operation.- Parameters:
a (array_like) â Tensor to âinvertâ. Its shape must be âsquareâ, i. e.,
prod(a.shape[:ind]) == prod(a.shape[ind:])
.ind (int, optional) â Number of first indices that are involved in the inverse sum. Must be a positive integer, default is 2.
- Returns:
b â aâs tensordot inverse, shape
a.shape[ind:] + a.shape[:ind]
.- Return type:
ndarray