From 195d97ad465e1f02ae143e09c00d894600019de3 Mon Sep 17 00:00:00 2001 From: liangzelang Date: Wed, 23 Sep 2020 10:53:02 +0800 Subject: [PATCH] Remove redundant check about IsInstance op --- mindspore/ops/operations/array_ops.py | 2 -- tests/ut/python/ops/test_array_ops_check.py | 5 ----- 2 files changed, 7 deletions(-) diff --git a/mindspore/ops/operations/array_ops.py b/mindspore/ops/operations/array_ops.py index 6517a912ce..be7e0ccb77 100644 --- a/mindspore/ops/operations/array_ops.py +++ b/mindspore/ops/operations/array_ops.py @@ -347,8 +347,6 @@ class IsInstance(PrimitiveWithInfer): sub_type_t = inst['dtype'] type_v = type_['value'] - if not isinstance(inst, type(mstype.tensor)): - validator.check_const_input("inst", inst['value'], self.name) validator.check_value_type("type_", type_v, [mstype.Type], self.name) if type_v == mstype.list_: diff --git a/tests/ut/python/ops/test_array_ops_check.py b/tests/ut/python/ops/test_array_ops_check.py index d28beff0ef..299c57a075 100755 --- a/tests/ut/python/ops/test_array_ops_check.py +++ b/tests/ut/python/ops/test_array_ops_check.py @@ -114,11 +114,6 @@ raise_set = [ 'desc_inputs': [mstype.number, None], 'skip': ['backward']}), - # inst is var - ('IsInstance0', { - 'block': (P.IsInstance(), {'exception': ValueError, 'error_keywords': ['IsInstance']}), - 'desc_inputs': [5.0, mstype.number], - 'skip': ['backward']}), # t is not mstype.Type ('IsInstance1', { 'block': (IsInstanceNet(5.0), {'exception': TypeError, 'error_keywords': ['IsInstance']}),