summaryrefslogtreecommitdiff
path: root/torch/autograd/variable.py
diff options
context:
space:
mode:
authorAdam Paszke <adam.paszke@gmail.com>2017-10-25 21:26:13 +0200
committerSoumith Chintala <soumith@gmail.com>2017-10-27 02:40:09 +0530
commitfa0f3cf98a57543a5a362ecde5133c42bc9443df (patch)
treeaaae5d207d518912524182273092ca9b085465de /torch/autograd/variable.py
parent61afb0d519eeb165a80f43c285ab2c528fc10879 (diff)
downloadpytorch-fa0f3cf98a57543a5a362ecde5133c42bc9443df.tar.gz
pytorch-fa0f3cf98a57543a5a362ecde5133c42bc9443df.tar.bz2
pytorch-fa0f3cf98a57543a5a362ecde5133c42bc9443df.zip
Re-enable and fix most JIT tests
Diffstat (limited to 'torch/autograd/variable.py')
-rw-r--r--torch/autograd/variable.py18
1 files changed, 5 insertions, 13 deletions
diff --git a/torch/autograd/variable.py b/torch/autograd/variable.py
index b3b5a92bbe..8b2655320c 100644
--- a/torch/autograd/variable.py
+++ b/torch/autograd/variable.py
@@ -426,15 +426,12 @@ class Variable(_C._VariableBase):
def bernoulli(self):
return Bernoulli.apply(self)
- def __add__(self, other):
- return self.add(other)
- __radd__ = __add__
+ __radd__ = __add__ = _C._VariableBase.add
def __iadd__(self, other):
return self.add_(other)
- def __sub__(self, other):
- return self.sub(other)
+ __sub__ = _C._VariableBase.sub
def __isub__(self, other):
return self.sub_(other)
@@ -442,9 +439,7 @@ class Variable(_C._VariableBase):
def __rsub__(self, other):
return -self + other
- def __mul__(self, other):
- return self.mul(other)
- __rmul__ = __mul__
+ __rmul__ = __mul__ = _C._VariableBase.mul
def __imul__(self, other):
return self.mul_(other)
@@ -454,9 +449,7 @@ class Variable(_C._VariableBase):
return NotImplemented
return self.matmul(other)
- def __div__(self, other):
- return self.div(other)
- __truediv__ = __div__
+ __truediv__ = __div__ = _C._VariableBase.div
def __rdiv__(self, other):
return self.reciprocal() * other
@@ -465,8 +458,7 @@ class Variable(_C._VariableBase):
def __idiv__(self, other):
return self.div_(other)
- def __pow__(self, other):
- return self.pow(other)
+ __pow__ = _C._VariableBase.pow
def __ipow__(self, other):
raise NotImplementedError("in-place pow not implemented")