Skip to content
fn

tensorsolve

→Tensor
tensorsolve(input: Tensor, other: Tensor, dims: tuple[int, ...] | list[int] | None = None)

Solve the tensor equation tensordot(A, X, dims=X.ndim) = B for X.

Parameters

inputTensor
Coefficient tensor A. After moving dims (when given) to the trailing axes, must satisfy A.shape[:B.ndim] == B.shape and prod(A.shape[B.ndim:]) == prod(B.shape).
otherTensor
Right-hand side tensor B.
dimstuple of int or list of int= None
Dimensions of input to be moved to the trailing positions before solving. If None (default), no dimensions are moved.

Returns

Tensor

Solution X of shape A.shape[B.ndim:] (after moving dims).

Used by 1