This is useful since in some torch code (such as in torch.distributions) torch.linalg.solve_triangular may be called on LinearOperator objects.
This PR shows nicely how the interface of having to pass properties of the tensor (such as upper/lower or whether it is unittriangular) to the function is rather awkward and encoding this on the tensors themselves simplifies a lot of the code for the user (cc @lezcano). For the purpose of registering the function, we need to deal with those args; I chose here to raise informative error messages when the args are inconsistent with the properties of the LinearOperator object.
This is useful since in some torch code (such as in torch.distributions)
torch.linalg.solve_triangular
may be called on LinearOperator objects.This PR shows nicely how the interface of having to pass properties of the tensor (such as upper/lower or whether it is unittriangular) to the function is rather awkward and encoding this on the tensors themselves simplifies a lot of the code for the user (cc @lezcano). For the purpose of registering the function, we need to deal with those args; I chose here to raise informative error messages when the args are inconsistent with the properties of the LinearOperator object.