forked from mindspore-Ecosystem/mindspore
!9883 Fixbug: rise example bug and benchmarkder=() exectuable
From: @lixiaohui33 Reviewed-by: @wuxuejian,@jonyguo,@lilongfei15 Signed-off-by: @lilongfei15
This commit is contained in:
commit
1adadfb0ae
|
@ -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 .")
|
||||
|
|
|
@ -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)
|
||||
"""
|
||||
|
||||
|
|
Loading…
Reference in New Issue