Skip to content

Commit acb032c

Browse files
committed
MAINT: address review comments
1 parent 2da3136 commit acb032c

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

torch_np/_ndarray.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def __mul__(self, other):
156156

157157
def __rmul__(self, other):
158158
other_tensor = asarray(other).get()
159-
return asarray(self._tensor.__mul__(other_tensor))
159+
return asarray(self._tensor.__rmul__(other_tensor))
160160

161161
def __truediv__(self, other):
162162
other_tensor = asarray(other).get()
@@ -179,23 +179,13 @@ def squeeze(self, axis=None):
179179
@axis_out_keepdims_wrapper
180180
def argmax(self, axis=None, out=None, *, keepdims=NoValue):
181181
axis = _helpers.allow_only_single_axis(axis)
182-
183-
if axis is None:
184-
tensor = torch.argmax(self._tensor)
185-
else:
186-
tensor = torch.argmax(self._tensor, axis)
187-
182+
tensor = torch.argmax(self._tensor, axis)
188183
return tensor
189184

190185
@axis_out_keepdims_wrapper
191186
def argmin(self, axis=None, out=None, *, keepdims=NoValue):
192187
axis = _helpers.allow_only_single_axis(axis)
193-
194-
if axis is None:
195-
tensor = torch.argmin(self._tensor)
196-
else:
197-
tensor = torch.argmin(self._tensor, axis)
198-
188+
tensor = torch.argmin(self._tensor, axis)
199189
return tensor
200190

201191
def reshape(self, *shape, order='C'):

0 commit comments

Comments
 (0)