gpytorch.Module now checks for is_tensor, not Variable
@@ -160,14 +160,14 @@ class Module(nn.Module):
def __call__(self, *inputs, **kwargs):
outputs = self.forward(*inputs, **kwargs)
- if isinstance(outputs, Variable) or isinstance(outputs, RandomVariable) or isinstance(outputs, LazyVariable):
+ if torch.is_tensor(outputs) or isinstance(outputs, RandomVariable) or isinstance(outputs, LazyVariable):
return outputs
for output in outputs:
if not (
- isinstance(output, RandomVariable) or isinstance(output, Variable) or isinstance(output, LazyVariable)
+ isinstance(output, RandomVariable) or torch.is_tensor(output) or isinstance(output, LazyVariable)
):
raise RuntimeError(
- "Output must be a RandomVariable, Variable, or LazyVariable. "
+ "Output must be a RandomVariable, torch.Tensor, or LazyVariable. "
"Was a {}".format(input.__class__.__name__)
)
if len(outputs) == 1:
