Skip to content

Commit 93d87cd

Browse files
committed
Remove conversion of new_root to dense operator in get_fantasy_strategy
Directly construct a BatchRepeatLinearOperator from new_root instead of converting it to a dense operator first.
1 parent e19a57e commit 93d87cd

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

gpytorch/models/exact_prediction_strategies.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
AddedDiagLinearOperator,
1111
BatchRepeatLinearOperator,
1212
ConstantMulLinearOperator,
13-
DenseLinearOperator,
1413
InterpolatedLinearOperator,
1514
LinearOperator,
1615
LowRankRootAddedDiagLinearOperator,
@@ -222,7 +221,7 @@ def get_fantasy_strategy(self, inputs, targets, full_inputs, full_targets, full_
222221
full_inputs = [fi.expand(fant_batch_shape + fi.shape) for fi in full_inputs]
223222
full_mean = full_mean.expand(fant_batch_shape + full_mean.shape)
224223
full_covar = BatchRepeatLinearOperator(full_covar, repeat_shape)
225-
new_root = BatchRepeatLinearOperator(DenseLinearOperator(new_root.to_dense()), repeat_shape)
224+
new_root = BatchRepeatLinearOperator(new_root, repeat_shape)
226225
# no need to repeat the covar cache, broadcasting will do the right thing
227226

228227
if isinstance(full_output, MultitaskMultivariateNormal):

0 commit comments

Comments
 (0)