use torch.no_grad() for evaluate_loss
from __future__ import absolute_import, division, print_function
+import torch
+
import pyro
from pyro.infer.elbo import ELBO
@@ -61,6 +63,7 @@ class SVI(object):
Evaluate the loss function. Any args or kwargs are passed to the model and guide.
"""
+ with torch.no_grad():
return self.loss(self.model, self.guide, *args, **kwargs)
def step(self, *args, **kwargs):
