aesara.tensor.nlinalg.tensorinv#
- aesara.tensor.nlinalg.tensorinv(a, ind=2)[source]#
Aesara utilization of numpy.linalg.tensorinv;
Compute the ‘inverse’ of an N-dimensional array. The result is an inverse for
arelative to the tensordot operationtensordot(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, shapea.shape[ind:] + a.shape[:ind].- Return type:
ndarray
- Raises:
LinAlgError – If
ais singular or not ‘square’ (in the above sense).