Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-04-07 08:56:42

0001 // Copyright (c) ONNX Project Contributors
0002 
0003 /*
0004  * SPDX-License-Identifier: Apache-2.0
0005  */
0006 
0007 // Adapter for all ops that remove consumed_inputs
0008 
0009 #pragma once
0010 
0011 #include <memory>
0012 #include <string>
0013 
0014 #include "onnx/version_converter/adapters/adapter.h"
0015 
0016 namespace ONNX_NAMESPACE {
0017 namespace version_conversion {
0018 
0019 class RemoveConsumedInputs : public Adapter {
0020  public:
0021   explicit RemoveConsumedInputs(const std::string& op_name, const OpSetID& initial, const OpSetID& target)
0022       : Adapter(op_name, initial, target) {}
0023 
0024   Node* adapt(std::shared_ptr<Graph>, Node* node) const override {
0025     if (node->hasAttribute(kconsumed_inputs))
0026       node->removeAttribute(kconsumed_inputs);
0027     return node;
0028   }
0029 };
0030 
0031 } // namespace version_conversion
0032 } // namespace ONNX_NAMESPACE