forked from mindspore-Ecosystem/mindspore
fix_bug_of_dynamic_shape_with_ms_function
This commit is contained in:
parent
394dfc07bc
commit
8f08bc281c
|
@ -1251,8 +1251,9 @@ void SessionBasic::GetParameterIndex(const KernelGraph *graph, const std::vector
|
||||||
MS_LOG(EXCEPTION) << "Shapes of input and parameter are different, input index: " << index
|
MS_LOG(EXCEPTION) << "Shapes of input and parameter are different, input index: " << index
|
||||||
<< ", parameter: " << param->fullname_with_scope();
|
<< ", parameter: " << param->fullname_with_scope();
|
||||||
}
|
}
|
||||||
|
bool is_dynamic = param->Shape()->IsDynamic();
|
||||||
for (size_t i = 0; i < input_shape.size(); i += 1) {
|
for (size_t i = 0; i < input_shape.size(); i += 1) {
|
||||||
if (input_shape[i] < 0 || static_cast<size_t>(input_shape[i]) != param_shape[i]) {
|
if (input_shape[i] < 0 || (static_cast<size_t>(input_shape[i]) != param_shape[i] && !is_dynamic)) {
|
||||||
MS_LOG(EXCEPTION) << "Shapes of input and parameter are different, input index: " << index
|
MS_LOG(EXCEPTION) << "Shapes of input and parameter are different, input index: " << index
|
||||||
<< ", parameter: " << param->fullname_with_scope();
|
<< ", parameter: " << param->fullname_with_scope();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue