You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This pull request enhances the robustness of the `MaxUnpool` operator in
ONNX Runtime by adding additional input validation and expanding test
coverage for invalid input scenarios. The changes improve error handling
for mismatched shapes, invalid dimensions, and other edge cases,
ensuring the operator fails gracefully and predictably when given
incorrect inputs.
**Operator input validation improvements:**
* Added runtime checks in `MaxUnpool::Compute` to ensure the
`kernel_shape` rank matches the expected pooling dimensions, and that
the indices tensor is present and correctly shaped.
* Added validation to ensure that computed output dimensions are
positive, with descriptive error messages if not.
* Enforced that the `output_shape` tensor, if provided, must have the
same number of elements as the rank of the input tensor.
**Test coverage enhancements:**
* Introduced multiple new tests in `unpool_op_test.cc` to cover invalid
input cases, including mismatched indices shapes, rank-0 and rank-2
input tensors, negative indices, and incorrect `output_shape` element
counts. These tests confirm that the operator fails with appropriate
error messages in these scenarios.
**References**
onnx/onnx#7997#28524
0 commit comments