cornellius-gp / linear_operator

A LinearOperator implementation to wrap the numerical nuts and bolts of GPyTorch
MIT License
95 stars 28 forks source link

Allow "-1" syntax for expand dimensions #5

Closed Balandat closed 2 years ago

Balandat commented 2 years ago

A "-1" in the arguments to expand means that the size of that dimension is not be changed. This is used in torch's distrbutions and without this support passing in LinearOperators into torch distributions raises a (spurious) error. This adds support (+ a test) for this.