!39157 [MS][BUG]return error for ascend not support

Merge pull request !39157 from mengyuanli/fix_bug_scatter
This commit is contained in:
i-robot 2022-07-30 02:41:04 +00:00 committed by Gitee
commit 8f2ecb6c45
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 5 additions and 2 deletions

View File

@ -6905,8 +6905,11 @@ class TensorScatterElements(Primitive):
validator.check_value_type("axis", axis, [int], self.name)
validator.check_value_type("reduction", reduction, [str], self.name)
validator.check_string(reduction, ["none", "add"], "reduction", self.name)
self.init_prim_io_names(
inputs=['data', 'indices', 'updates'], outputs=['y'])
self.init_prim_io_names(inputs=['data', 'indices', 'updates'], outputs=['y'])
target = context.get_context("device_target")
if reduction != 'none' and target.lower() == "ascend":
raise ValueError(f"Currently Ascend device_target only support `reduction`='none', "
f"but got {reduction}")
class ExtractVolumePatches(Primitive):