Skip to content

Commit 74371e5

Browse files
committed
MAINT: apply suggestions from review
1 parent 4dba507 commit 74371e5

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

torch_np/_detail/implementations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def split_helper_int(tensor, indices_or_sections, axis, strict=False):
4646
num, sz = l % n, l // n + 1
4747
lst = [sz] * num
4848

49-
lst += [sz - 1] * (n - num)
49+
lst += [sz - 1] * (n - num)
5050

5151
result = torch.split(tensor, lst, axis)
5252

torch_np/_wrapper.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def array_split(ary, indices_or_sections, axis=0):
166166

167167
result = _impl.split_helper(tensor, indices_or_sections, axis)
168168

169-
return tuple(maybe_set_base(_, base) for _ in result)
169+
return tuple(maybe_set_base(x, base) for x in result)
170170

171171

172172
def split(ary, indices_or_sections, axis=0):
@@ -176,7 +176,7 @@ def split(ary, indices_or_sections, axis=0):
176176

177177
result = _impl.split_helper(tensor, indices_or_sections, axis, strict=True)
178178

179-
return tuple(maybe_set_base(_, base) for _ in result)
179+
return tuple(maybe_set_base(x, base) for x in result)
180180

181181

182182
def hsplit(ary, indices_or_sections):
@@ -190,7 +190,7 @@ def hsplit(ary, indices_or_sections):
190190

191191
result = _impl.split_helper(tensor, indices_or_sections, axis, strict=True)
192192

193-
return tuple(maybe_set_base(_, base) for _ in result)
193+
return tuple(maybe_set_base(x, base) for x in result)
194194

195195

196196
def vsplit(ary, indices_or_sections):
@@ -201,7 +201,7 @@ def vsplit(ary, indices_or_sections):
201201
raise ValueError("vsplit only works on arrays of 2 or more dimensions")
202202
result = _impl.split_helper(tensor, indices_or_sections, 0, strict=True)
203203

204-
return tuple(maybe_set_base(_, base) for _ in result)
204+
return tuple(maybe_set_base(x, base) for x in result)
205205

206206

207207
def dsplit(ary, indices_or_sections):
@@ -212,7 +212,7 @@ def dsplit(ary, indices_or_sections):
212212
raise ValueError("dsplit only works on arrays of 3 or more dimensions")
213213
result = _impl.split_helper(tensor, indices_or_sections, 2, strict=True)
214214

215-
return tuple(maybe_set_base(_, base) for _ in result)
215+
return tuple(maybe_set_base(x, base) for x in result)
216216

217217

218218
def kron(a, b):

0 commit comments

Comments
 (0)