DML EP squeeze all axes when empty (#12649)

DML EP squeeze empty axes
This commit is contained in:
Dwayne Robinson 2022-08-19 08:56:03 -07:00 committed by GitHub
parent b270334e1e
commit aa85092b51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1852,8 +1852,14 @@ namespace OperatorHelper
m_axes = kernelInformation.GetAttributes().GetOptionalAttributeVectorInt32(AttrName::Axes);
}
std::vector<DimensionType> inputDimensions = shapeInformation.GetInputTensorShape(0);
HandleNegativeAxes(/*inout*/ m_axes, gsl::narrow_cast<uint32_t>(inputDimensions.size()));
std::sort(m_axes.begin(), m_axes.end());
if (m_axes.empty())
{
m_axes.resize(inputDimensions.size());
std::iota(m_axes.begin(), m_axes.end(), 0u);
}
}
std::vector<EdgeShapes> SqueezeHelper::GetOutputShapes(const MLShapeInferenceContext& shapeInfo) const