Skip to content

Commit b71dfdb

Browse files
authored
更新npu_910b和npu_910a文件,增加判断timesteps为空的情况 (#2308)
1 parent c9fd8e7 commit b71dfdb

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/mindtorch/_apis/npu_910a.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1536,6 +1536,8 @@ def cdist(x1, x2, p):
15361536
return legacy.cdist(x1, x2, float(p))
15371537

15381538
def unstack_view(input, dim):
1539+
if input.shape[dim] == 0:
1540+
return tuple()
15391541
if ENABLE_PYBOOST:
15401542
return pyboost.unstack_ext_view_op(input, dim)
15411543
return legacy.unstack(input, dim, input.shape[dim])

src/mindtorch/_apis/npu_910b.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1526,6 +1526,8 @@ def cdist(x1, x2, p):
15261526
return legacy.cdist(x1, x2, float(p))
15271527

15281528
def unstack_view(input, dim):
1529+
if input.shape[dim] == 0:
1530+
return tuple()
15291531
if ENABLE_PYBOOST:
15301532
return pyboost.unstack_ext_view_op(input, dim)
15311533
return legacy.unstack(input, dim, input.shape[dim])

0 commit comments

Comments
 (0)