Starting with this release, the `LazyTensor` functionality of GPyTorch has been pulled out into its own separate Python package, called [linear_operator](https://github.com/cornellius-gp/linear_operator). Most users won't notice the difference (at the moment), but power users will notice a few changes.
If you have your own custom LazyTensor code, don't worry: this release is backwards compatible! However, you'll see a lot of annoying deprecation warnings 😄
LazyTensor -> LinearOperator
- All `gpytorch.lazy.*LazyTensor` classes now live in the `linear_operator` repo, and are now called `linear_operator.operator.*LinearOperator`.
- For example, `gpytorch.lazy.DiagLazyTensor` is now `linear_operator.operators.DiagLinearOperator`
- The only major naming change: `NonLazyTensor` is now `DenseLinearOperator`
- `gpytorch.lazify` and `gpytorch.delazify` are now `linear_operator.to_linear_operator` and `linear_operator.to_dense`, respectively.
- The `_quad_form_derivative` method has been renamed to `_bilinear_derivative` (a more accurate name!)
- `LinearOperator` method names now reflect their corresponding PyTorch names. This includes:
- `add_diag` -> `add_diagonal`
- `diag` -> `diagonal`
- `inv_matmul` -> `solve`
- `symeig` -> `eigh` and `eigvalsh`
- `LinearOperator` now has the `mT` property
__torch_function__ functionality
LinearOperators are now compatible with the torch api! For example, the following code works:
python
diag_linear_op = linear_operator.operators.DiagLinearOperator(torch.randn(10))
torch.matmul(diag_linear_op, torch.randn(10, 2)) returns a torch.Tensor!
Other files that have moved:
- `gpytorch.functions` - all of the core functions used by LazyTensors now live in the LinearOperator repo. This includes: diagonalization, dsmm, inv_quad, inv_quad_logdet, matmul, pivoted_cholesky, root_decomposition, solve (formally inv_matmul), and sqrt_inv_matmul
- `gpytorch.utils` - a few have moved to the LinearOperator repo. This includes: broadcasting, cholesky, contour_intergral_quad, getitem, interpolation, lanczos, linear_cg, minres, permutation, stable_pinverse, qr, sparse, SothcasticLQ, and toeplitz.
**Full Changelog**: https://github.com/cornellius-gp/gpytorch/compare/v1.8.1...v1.9.0