Skip to content

Commit 33662d1

Browse files
committed
Pass linear operator to fantasy strategy constructor instead of tensor
1 parent 58c0335 commit 33662d1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

gpytorch/models/exact_prediction_strategies.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ def get_fantasy_strategy(self, inputs, targets, full_inputs, full_targets, full_
211211

212212
# now update the root and root inverse
213213
new_lt = self.lik_train_train_covar.cat_rows(fant_train_covar, fant_fant_covar)
214-
new_root = new_lt.root_decomposition().root.to_dense()
215-
new_covar_cache = new_lt.root_inv_decomposition().root.to_dense()
214+
new_root = new_lt.root_decomposition().root
215+
new_covar_cache = new_lt.root_inv_decomposition().root
216216

217217
# Expand inputs accordingly if necessary (for fantasies at the same points)
218218
if full_inputs[0].dim() <= full_targets.dim():
@@ -238,7 +238,7 @@ def get_fantasy_strategy(self, inputs, targets, full_inputs, full_targets, full_
238238
inv_root=new_covar_cache,
239239
)
240240
add_to_cache(fant_strat, "mean_cache", fant_mean_cache)
241-
add_to_cache(fant_strat, "covar_cache", new_covar_cache)
241+
add_to_cache(fant_strat, "covar_cache", new_covar_cache.to_dense())
242242
return fant_strat
243243

244244
@property

0 commit comments

Comments
 (0)