mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-26 19:52:38 +00:00
DML EP allow squeeze-13 axes to be empty (#13635)
### Description **Description**: [ONNX Squeeze-13](https://github.com/onnx/onnx/blob/main/docs/Operators.md#Squeeze) treats empty `axes` as if all axes had been given. This works for [earlier Squeeze versions](https://github.com/microsoft/onnxruntime/pull/12649), but Squeeze-13 checks for axes as a dynamic input tensor, which means it needs to checked for existence before accessing. ### Motivation and Context - *Why is this change required? What problem does it solve?* Fixes a customer model. Makes ORT DML EP consistent with spec.
This commit is contained in:
parent
3201a1f841
commit
55fb790d88
1 changed files with 4 additions and 1 deletions
|
|
@ -2052,7 +2052,10 @@ namespace OperatorHelper
|
|||
{
|
||||
if (opsetVersion >= 13) // Axes are a dynamic input parameter.
|
||||
{
|
||||
ReadCpuLocalTensorIntoInt32(kernelInformation.GetConstantInputTensor(1), /*out*/ m_axes);
|
||||
if (kernelInformation.IsInputValid(1))
|
||||
{
|
||||
ReadCpuLocalTensorIntoInt32(kernelInformation.GetConstantInputTensor(1), /*out*/ m_axes);
|
||||
}
|
||||
}
|
||||
else // Axes were a constant attribute parameter.
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue