Skip to content

Commit

Permalink
Move lambda to global func
Browse files Browse the repository at this point in the history
  • Loading branch information
TobyBoyne committed Feb 27, 2024
1 parent 392dd41 commit 721f906
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gpytorch/kernels/index_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def __init__(
if prior is not None:
if not isinstance(prior, Prior):
raise TypeError("Expected gpytorch.priors.Prior but got " + type(prior).__name__)
self.register_prior("IndexKernelPrior", prior, lambda m: m._eval_covar_matrix())
self.register_prior("IndexKernelPrior", prior, _index_kernel_prior_closure)

self.register_constraint("raw_var", var_constraint)

Expand Down Expand Up @@ -109,3 +109,7 @@ def forward(self, i1, i2, **params):
right_interp_indices=i2.expand(batch_shape + i2.shape[-2:]),
)
return res


def _index_kernel_prior_closure(m):
return m._eval_covar_matrix()

0 comments on commit 721f906

Please sign in to comment.