Skip to content

Commit

Permalink
Fix MaxPooling kernel
Browse files Browse the repository at this point in the history
  • Loading branch information
sumitsays committed Dec 10, 2022
1 parent b22a883 commit c583a8d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,15 @@ class DmlOperatorPooling : public DmlOperator, public PoolingHelperBase
PoolingHelperBase(kernelInfo, kernelInfo.GetTensorShapeDescription(), useGlobalPooling),
m_function(function)
{
DmlOperator::Initialize(kernelInfo);
if (function == DML_OPERATOR_MAX_POOLING2)
{
auto kernelOutputIndices = std::vector<std::optional<uint32_t>> { 0, 1};
DmlOperator::Initialize(kernelInfo, std::nullopt, kernelOutputIndices);
}
else
{
DmlOperator::Initialize(kernelInfo);
}

std::vector<DML_TENSOR_DESC> inputDescs = GetDmlInputDescs();
std::vector<DML_TENSOR_DESC> outputDescs = GetDmlOutputDescs();
Expand Down
2 changes: 1 addition & 1 deletion onnxruntime/core/session/inference_session.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1415,7 +1415,7 @@ common::Status InferenceSession::Initialize() {
}

// This transformer applies DML-specific fusions that go beyond what ORT offers by default
bool dml_operator_fusion_enabled = session_options_.graph_optimization_level > TransformerLevel::Level1;
bool dml_operator_fusion_enabled = session_options_.graph_optimization_level >= TransformerLevel::Level2;
if (dml_operator_fusion_enabled) {
std::unique_ptr<onnxruntime::GraphTransformer> dmlOperatorFusionTransformer = std::make_unique<Dml::GraphTransformer>("DmlOperatorFusionTransformer");
if (dmlOperatorFusionTransformer == nullptr) {
Expand Down

0 comments on commit c583a8d

Please sign in to comment.