!45833 Handle dict log printing in the interpretation node.

Merge pull request !45833 from Margaret_wangrui/dict
This commit is contained in:
i-robot 2022-11-23 07:04:16 +00:00 committed by Gitee
commit 31440a046f
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 4 additions and 3 deletions

View File

@ -2222,14 +2222,15 @@ class PyInterpretEvaluator : public TransitionPrimEvaluator {
const auto &local_abs = element.second;
const auto &local_abs_val = local_abs->BuildValue();
MS_EXCEPTION_IF_NULL(local_abs_val);
auto py_data_name = py::str(ValueToPyData(name->BuildValue()));
if (local_abs_val == kAnyValue) {
MS_EXCEPTION(ValueError) << "When using JIT Fallback to handle script '" << script
<< "', the inputs should be constant, but found variable '" << name
<< "', the inputs should be constant, but found variable '" << py_data_name
<< "' to be nonconstant.";
}
if (local_abs->isa<abstract::AbstractTensor>()) {
MS_LOG(WARNING) << "When using JIT Fallback to handle script '" << script << "', found variable '" << name
<< "' to be a tensor.";
MS_LOG(WARNING) << "When using JIT Fallback to handle script '" << script << "', found variable '"
<< py_data_name << "' to be a tensor.";
}
}
}