mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-23 22:13:38 +00:00
Fixed a minor bug in layout transformation for Resize (#21954)
Since opset 18, 'scales' and 'sizes' constant inputs can be 2D tensors, transpose for 2D tensors are not supported at current implementation, fix it by only allowing 4D constant inputs.
This commit is contained in:
parent
55e0128b13
commit
7b9db658c3
1 changed files with 5 additions and 1 deletions
|
|
@ -177,7 +177,11 @@ Status TransformLayoutForEP(Graph& graph, bool& modified, const IExecutionProvid
|
|||
for (size_t i = 2; i < node->Inputs().size(); i++) {
|
||||
auto constant = api_graph->GetConstant(node->Inputs()[i]);
|
||||
if (constant != nullptr && constant->Data().size() > 0) {
|
||||
input_perms.push_back(&input_perm);
|
||||
// Starting from opset version 18, the 'scales' and 'sizes' can be any length up to the input rank.
|
||||
// However, our current implementation only supports the transposition of 4D tensors.
|
||||
if (constant->NumElements() == 4) {
|
||||
input_perms.push_back(&input_perm);
|
||||
}
|
||||
} else {
|
||||
// TODO: Fix inconsistency. We should Transpose the non-const inputs so that the result of our changes
|
||||
// is consistent - all layout specific inputs are in NHWC format when we're done.
|
||||
|
|
|
|||
Loading…
Reference in a new issue