Skip to content

Commit 8026740

Browse files
authored
SINGA-478 Change __idiv__ to __itruediv__ for py3
1 parent 744a979 commit 8026740

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

python/singa/tensor.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -468,20 +468,8 @@ def __imul__(self, x):
468468
self.data *= float(x)
469469
return self
470470

471-
def __idiv__(self, x):
472-
''' inplace element-wise division by a tensor or a float value.
473-
474-
Args:
475-
x (float or Tensor):
476-
'''
477-
if isinstance(x, Tensor):
478-
self.data *= (1.0/x.data)
479-
else:
480-
self.data *= (1.0/float(x))
481-
return self
482-
483471
def __itruediv__(self, x):
484-
''' For python3: inplace element-wise division by a tensor or a float value.
472+
''' inplace element-wise division by a tensor or a float value.
485473
486474
Args:
487475
x (float or Tensor):

0 commit comments

Comments
 (0)