Computes the solution X to the system torch_tensordot(A, X) = B.
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.
linalg_tensorsolve(A, B, dims =NULL)
Arguments
A: (Tensor): tensor to solve for.
B: (Tensor): the solution
dims: (Tuple[int], optional): dimensions of A to be moved. If NULL, no dimensions are moved. Default: NULL.
Details
If dims is specified, A will be reshaped as A = movedim(A, dims, seq(len(dims) - A$ndim + 1, 0))
Supports inputs of float, double, cfloat and cdouble dtypes.