From 88b95ddc78ec6f87ae11327b79d19952047c887e Mon Sep 17 00:00:00 2001 From: wangshuide2020 Date: Tue, 29 Jun 2021 11:19:51 +0800 Subject: [PATCH] add more detail info for TypeError. --- mindspore/_checkparam.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mindspore/_checkparam.py b/mindspore/_checkparam.py index b0ca0771565..2ada3909499 100644 --- a/mindspore/_checkparam.py +++ b/mindspore/_checkparam.py @@ -488,7 +488,9 @@ class Validator: type_str = (type(type_).__name__ if isinstance(type_, (tuple, list)) else "") + str(type_) raise TypeError(f'For \'{prim_name}\', the type of `{arg_name}` should be subclass' f' of {", ".join((str(x) for x in template_types))}, but got {type_str}.' - f' {addition_error_info}') + f' {addition_error_info}. This message is only for reference. The supported data types' + f' depend on the hardware that executes the operator' + f' and it is a subset of the data types above.') @staticmethod def check_const_input(arg_name, arg_value, prim_name):