Skip to content

Commit ea3f909

Browse files
sdaultonfacebook-github-bot
authored andcommitted
remove unused copy likelihood state_dict in SingleTaskGP (#194)
Summary: Pull Request resolved: #194 see title Reviewed By: danielrjiang Differential Revision: D16036033 fbshipit-source-id: e85c15f08de9d79e68ad3e5557191164a8e66a1e
1 parent 3b6d8aa commit ea3f909

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

botorch/models/converter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def _check_compatibility(models: ModelListGP) -> None:
6262
)
6363

6464
# TODO: Add support for custom likelihoods
65-
if any(hasattr(m, "_likelihood_state_dict") for m in models):
65+
if any(getattr(m, "_is_custom_likelihood", False) for m in models):
6666
raise NotImplementedError(
6767
"Conversion of models with custom likelihoods is currently unsupported."
6868
)

botorch/models/gp_regression.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
Gaussian Process Regression models based on GPyTorch models.
77
"""
88

9-
from copy import deepcopy
109
from typing import Any, Optional
1110

1211
import torch
@@ -88,7 +87,7 @@ def __init__(
8887
),
8988
)
9089
else:
91-
self._likelihood_state_dict = deepcopy(likelihood.state_dict())
90+
self._is_custom_likelihood = True
9291
ExactGP.__init__(self, train_X, train_Y, likelihood)
9392
self.mean_module = ConstantMean(batch_shape=self._aug_batch_shape)
9493
self.covar_module = ScaleKernel(

0 commit comments

Comments
 (0)