mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-26 22:35:43 +00:00
[WebNN EP] Remove workaround for dynamic shape (#17644)
As now we have the FreeDimensionOverrides option to support dynamic shape, we can remove the previous workaround.
This commit is contained in:
parent
e70a23f8dc
commit
ce287a4e77
2 changed files with 8 additions and 8 deletions
|
|
@ -53,9 +53,12 @@ bool IsInputSupported(const NodeArg& input, const std::string& parent_name, cons
|
|||
}
|
||||
|
||||
for (const auto& dim : shape_proto->dim()) {
|
||||
// For now we workaround dynamic shape support by assuming 1.
|
||||
// WebNN doesn't support dynamic shape - use sessionOptions.freeDimensionOverrides to fix the shape.
|
||||
if (!dim.has_dim_value()) {
|
||||
LOGS(logger, VERBOSE) << "Dynamic shape is not supported for now, assume to be 1, for input:" << input_name;
|
||||
LOGS(logger, VERBOSE) << "Dynamic shape is not supported, "
|
||||
<< "use sessionOptions.FreeDimensionOverrides to set a fixed shape for input: "
|
||||
<< input_name;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -218,12 +218,9 @@ Status ModelBuilder::RegisterModelInputOutput(const NodeArg& node_arg, bool is_i
|
|||
} else {
|
||||
dims.reserve(shape.size());
|
||||
for (const auto& dim : shape) {
|
||||
if (!dim.has_dim_value()) {
|
||||
// FIXME: support dyanmic shape.
|
||||
dims.push_back(1);
|
||||
} else {
|
||||
dims.push_back(SafeInt<int32_t>(dim.dim_value()));
|
||||
}
|
||||
// dim_param free dimensions should have already been excluded by IsInputSupported().
|
||||
assert(dim.has_dim_value());
|
||||
dims.push_back(SafeInt<int32_t>(dim.dim_value()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue