cornellius-gp / linear_operator

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

Remove @cached decorator for TriangularLinearOperator.to_dense #51

Closed Balandat closed 1 year ago

Balandat commented 1 year ago

This seems unnecessary and also causes issues with pickling: https://github.com/cornellius-gp/gpytorch/issues/2264#issue-1567345205

esantorella commented 1 year ago

My gut instinct is that this is right, since I've seen the same dense tensor getting cached to multiple places, including via this function. If this causes any performance degradation, hopefully the BoTorch tutorials runs and the tracking I'm adding to them would pick that up (https://github.com/pytorch/botorch/pull/1695).