File indexing completed on 2025-04-03 08:57:54
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include <memory>
0012
0013 #include "onnx/version_converter/adapters/adapter.h"
0014
0015 namespace ONNX_NAMESPACE {
0016 namespace version_conversion {
0017
0018 class MaxPool_8_7 final : public Adapter {
0019 public:
0020 explicit MaxPool_8_7() : Adapter("MaxPool", OpSetID(8), OpSetID(7)) {}
0021
0022 void adapt_maxpool_8_7(std::shared_ptr<Graph>, Node* node) const {
0023 const ArrayRef<Value*>& outputs = node->outputs();
0024 ONNX_ASSERTM(outputs.size() != 2, "Opset version 7 of MaxPool cannot include Indices output");
0025 if (node->hasAttribute(kstorage_order))
0026 node->removeAttribute(kstorage_order);
0027 }
0028
0029 Node* adapt(std::shared_ptr<Graph> graph, Node* node) const override {
0030 adapt_maxpool_8_7(graph, node);
0031 return node;
0032 }
0033 };
0034
0035 }
0036 }