Open TobyBoyne opened 4 months ago
Currently, index kernels cannot be pickled. This PR moves an anonymous function to the module-level to allow pickling.
Current behaviour is that index kernels with a prior throw an error when pickling.
from gpytorch.kernels import IndexKernel from gpytorch.priors import LKJPrior import pickle kernel = IndexKernel(2, prior=LKJPrior(2, 1)) pickle.dumps(kernel)
This throws > AttributeError: Can't pickle local object 'IndexKernel.__init__.<locals>.<lambda>'
> AttributeError: Can't pickle local object 'IndexKernel.__init__.<locals>.<lambda>'
There isn't an open issue for this in particular, but there is a request for pickle-able kernels. (#907, #2264)
Currently, index kernels cannot be pickled. This PR moves an anonymous function to the module-level to allow pickling.
Current behaviour is that index kernels with a prior throw an error when pickling.
This throws
> AttributeError: Can't pickle local object 'IndexKernel.__init__.<locals>.<lambda>'
There isn't an open issue for this in particular, but there is a request for pickle-able kernels. (#907, #2264)