Skip to content

Commit 3dfb872

Browse files
ev-brlezcano
andauthored
Update torch_np/_detail/implementations.py
Co-authored-by: Mario Lezcano Casado <[email protected]>
1 parent 51a8d12 commit 3dfb872

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

torch_np/_detail/implementations.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +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-
if n > l:
50-
lst += [0] * (n - l)
51-
else:
52-
lrest = l - num * sz
53-
54-
sz_1 = sz - 1
55-
num_1 = lrest // sz_1
56-
lst += [sz_1] * num_1
49+
lst += [sz - 1] * (n - num)
5750

5851
result = torch.split(tensor, lst, axis)
5952

0 commit comments

Comments
 (0)