Fix cuda compatability for MulLazyVariable.evaluate()
@@ -301,8 +301,11 @@ class MulLazyVariable(LazyVariable):
return res
def evaluate(self):
- res = Variable(torch.ones(self.size()))
+ res = None
for lazy_var in self.lazy_vars:
+ if res is None:
+ res = lazy_var.evaluate()
+ else:
res = res * lazy_var.evaluate()
if self.added_diag is not None:
