Skip to content

Commit 4c048d1

Browse files
committed
polish stack
1 parent c8092d6 commit 4c048d1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

python/jittor/misc.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,9 +346,8 @@ def stack(x, dim=0):
346346
[[4 5 6]]]
347347
'''
348348
assert isinstance(x, Sequence)
349-
for x_ in x:
350-
if not isinstance(x_, jt.Var):
351-
x_ = jt.Var(x_)
349+
for i,x_ in enumerate(x):
350+
x[i] = jt.array(x_)
352351
if len(x) < 2:
353352
return x[0].unsqueeze(dim)
354353

0 commit comments

Comments
 (0)