Compute the multiplicative inverse of lucid.tensordot.
If and
, requires
and computes a tensor of shape
input.shape[ind:] + input.shape[:ind] such that
tensordot(input, X, ind) is the ind-dimensional identity tensor.
Parameters
inputTensorTensor to invert. Must satisfy
prod(input.shape[:ind]) == prod(input.shape[ind:]).indint= 2Positive index at which to split the dimensions of
input.
Default: 2.Returns
TensorInverse tensor of shape input.shape[ind:] + input.shape[:ind].
Raises
RuntimeErrorIf
ind <= 0, ind > input.ndim, or
prod(input.shape[:ind]) != prod(input.shape[ind:]).LinAlgErrorIf the reshaped
(m, m) matrix is not invertible.