!44047 raise error when summary operator is called in pynative mode

Merge pull request !44047 from maning202007/master
This commit is contained in:
i-robot 2022-10-18 08:11:54 +00:00 committed by Gitee
commit 255023c539
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 4 additions and 4 deletions

View File

@ -97,7 +97,7 @@ class ScalarSummary(Primitive):
self.add_prim_attr("side_effect_io", True)
def __call__(self, *args):
logger.warning("PyNative not support Operator {}".format(self.__class__.__name__))
raise RuntimenError(f"PyNative not support Operator '{self.__class__.__name__}'")
class ImageSummary(PrimitiveWithInfer):
@ -155,7 +155,7 @@ class ImageSummary(PrimitiveWithInfer):
return SUMMARY_RETURN_VALUE
def __call__(self, *args):
logger.warning("PyNative not support Operator {}".format(self.__class__.__name__))
raise RuntimenError(f"PyNative not support Operator '{self.__class__.__name__}'")
class TensorSummary(Primitive):
@ -202,7 +202,7 @@ class TensorSummary(Primitive):
self.add_prim_attr("side_effect_io", True)
def __call__(self, *args):
logger.warning("PyNative not support Operator {}".format(self.__class__.__name__))
raise RuntimenError(f"PyNative not support Operator '{self.__class__.__name__}'")
class HistogramSummary(PrimitiveWithInfer):
@ -260,7 +260,7 @@ class HistogramSummary(PrimitiveWithInfer):
return SUMMARY_RETURN_VALUE
def __call__(self, *args):
logger.warning("PyNative not support Operator {}".format(self.__class__.__name__))
raise RuntimenError(f"PyNative not support Operator '{self.__class__.__name__}'")
class InsertGradientOf(PrimitiveWithInfer):