torch.linalg.tensorsolve
torch.linalg.tensorsolve(A, B, dims=None, *, out=None) -> Tensor
Computes the solution X to the system torch.tensordot(A, X) =
   B.
If m is the product of the first "B".ndim  dimensions of "A"
   and n is the product of the rest of the dimensions, this function
   expects m and n to be equal.
The returned tensor x satisfies tensordot("A", x, dims=x.ndim)
   == "B". x has shape "A"[B.ndim:].
If "dims" is specified, "A" will be reshaped as
  A = movedim(A, dims, range(len(dims) - A.ndim + 1, 0))

Supports inputs of float, double, cfloat and cdouble dtypes.
See also:
 "torch.linalg.tensorinv()" computes the multiplicative inverse of
 "torch.tensordot()".

Parameters:
      * A (Tensor) -- tensor to solve for. Its shape must
        satisfy prod("A".shape[:"B".ndim]) ==
        prod("A".shape["B".ndim:]).
  * **B** (*Tensor*) -- tensor of shape "A"*.shape[:*"B"*.ndim]*.
