Function torch::linalg::tensorsolve¶
Defined in File linalg.h
Function Documentation¶
-
inline Tensor torch::linalg::tensorsolve(const Tensor &input, const Tensor &other, OptionalIntArrayRef dims)¶
Computes a tensor
x
such thattensordot(input, x, dims=x.dim()) = other
.See https://pytorch.org/docs/main/linalg.html#torch.linalg.tensorsolve
Example:
auto a = torch::eye(2*3*4).reshape({2*3, 4, 2, 3, 4}); auto b = torch::randn(2*3, 4); auto x = torch::linalg::tensorsolve(a, b);