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:
Dwayne Robinson 2022-11-15 11:03:21 -08:00 committed by GitHub
parent 3201a1f841
commit 55fb790d88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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.
{