Skip to content

Commit a2d786a

Browse files
authored
更新npu_901a和npu_910b文件的代码,解决布尔值的问题 (#2302)
1 parent 3533d05 commit a2d786a

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

mindtorch/_apis/npu_910a.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -459,8 +459,6 @@ def sum(input, dim, keepdim, dtype):
459459
Tensor: The tensor with summed elements.
460460
"""
461461
if ENABLE_PYBOOST:
462-
if dtype is None:
463-
dtype = input.dtype
464462
return pyboost.sum_ext_op(input, dim, keepdim, dtype)
465463
return legacy.reduce_sum(input.astype(dtype), dim, keepdim)
466464

@@ -2581,4 +2579,4 @@ def ifftn(input, s, dim, norm):
25812579
return pyboost.ifftn_op(input, s, dim, norm)
25822580

25832581
def fftn(input, s, dim, norm):
2584-
return pyboost.fftn_op(input, s, dim, norm)
2582+
return pyboost.fftn_op(input, s, dim, norm)

mindtorch/_apis/npu_910b.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -461,8 +461,6 @@ def sum(input, dim, keepdim, dtype):
461461
Tensor: The tensor with summed elements.
462462
"""
463463
if ENABLE_PYBOOST:
464-
if dtype is None:
465-
dtype = input.dtype
466464
return pyboost.sum_ext_op(input, dim, keepdim, dtype)
467465
return legacy.reduce_sum(input.astype(dtype), dim, keepdim)
468466

@@ -2524,4 +2522,4 @@ def ifftn(input, s, dim, norm):
25242522
return pyboost.ifftn_op(input, s, dim, norm)
25252523

25262524
def fftn(input, s, dim, norm):
2527-
return pyboost.fftn_op(input, s, dim, norm)
2525+
return pyboost.fftn_op(input, s, dim, norm)

0 commit comments

Comments
 (0)