Fix Resize op input check (#16594)

### Description
onnxjs contains a `Resize` op input check which is outdated since opset
9. Currently `Resize` supports up to 4 inputs. This PR looses the input
check.



### Motivation and Context

Fixes #15636
This commit is contained in:
Zimon Tai 2023-08-10 06:42:30 +08:00 committed by GitHub
parent 7d340256f1
commit a3e02e8e2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -332,8 +332,9 @@ class GraphImpl implements Graph, Graph.Transformer {
for (const input of nodeProto.input) {
const dataIndex = dataIndices.get(input);
if (typeof dataIndex === 'undefined') {
// handle exception when opset > 9 and roi not given
if (input === '' && nodeProto.input.length === 3 && nodeProto.opType === 'Resize') {
// handle exception when opset > 9 and roi / scales not given
if (input === '' && (nodeProto.input.length === 3 || nodeProto.input.length === 4) &&
nodeProto.opType === 'Resize') {
continue;
}
throw new Error(`unrecognized input '${input}' for node: ${nodeProto.name}`);