!9883 Fixbug: rise example bug and benchmarkder=() exectuable

From: @lixiaohui33
Reviewed-by: @wuxuejian,@jonyguo,@lilongfei15
Signed-off-by: @lilongfei15
This commit is contained in:
mindspore-ci-bot 2020-12-26 17:47:43 +08:00 committed by Gitee
commit 1adadfb0ae
2 changed files with 2 additions and 2 deletions

View File

@ -167,7 +167,7 @@ class ImageClassificationRunner:
if not explainers:
raise ValueError("Argument explainers is empty.")
if benchmarkers:
if benchmarkers is not None:
check_value_type("benchmarkers", benchmarkers, list)
if not all(isinstance(ele, AttributionMetric) for ele in benchmarkers):
raise TypeError("Argument benchmarkers is not list of mindspore.explainer.benchmark .")

View File

@ -77,7 +77,7 @@ class RISE(PerturbationAttribution):
>>> targets = 5
>>> saliency = rise(inputs, targets)
>>> # `targets` can also be a 2D tensor
>>> targets = ms.Tensor([[5], [1]])
>>> targets = ms.Tensor([[5], [1]], ms.int32)
>>> saliency = rise(inputs, targets)
"""