Open chrisyeh96 opened 9 months ago
Hmm interesting. Yeah not sure why the docs contain this, seems like this was never implemented. Support is there for many unary or binary operators, but torch.cat
operates on a list of objects rather than a LinearOperator
directly. @gpleiss have you considered this and similar operators in the past?
There is a CatLinearOperator
that implements what is needed. I wish that linear_operator
could implement LinearOperator
in a way such that calling torch.cat
on a list of LinearOperator
automatically creates a CatLinearOperator
Yes, that makes a lot of sense and would be great to have. I'm not sure if that is easy to do with the __torch_function__
setup that we leverage for doing this dispatching under the hood. Let me see if I can get some intel on this.
🐛 Bug
torch.cat
fails for linear operators.To reproduce
Code snippet to reproduce
Stack trace/error message
Expected Behavior
According to the documentation,
torch.cat
should work on linear operators.System information
Please complete the following information: