fix IsInstance op bug when input is tensor

pull/6738/head
liangzelang 4 years ago
parent c291e0b2ba
commit ca84130080

@ -64,7 +64,9 @@ bool UndeterminedType::operator==(const Type &other) const {
}
TypePtr TensorType::DeepCopy() const {
MS_EXCEPTION_IF_NULL(element_type_);
if (element_type_ == nullptr) {
return std::make_shared<TensorType>();
}
if (IsGeneric()) {
return std::make_shared<TensorType>();
}

@ -347,7 +347,8 @@ class IsInstance(PrimitiveWithInfer):
sub_type_t = inst['dtype']
type_v = type_['value']
validator.check_const_input("inst", inst['value'], self.name)
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_:

Loading…
Cancel
Save