Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-04-03 08:57:54

0001 // Copyright (c) ONNX Project Contributors
0002 
0003 /*
0004  * SPDX-License-Identifier: Apache-2.0
0005  */
0006 
0007 // Adapter for BatchNormalization in default domain from version 13 to 14
0008 
0009 #pragma once
0010 
0011 #include "onnx/version_converter/adapters/adapter.h"
0012 
0013 namespace ONNX_NAMESPACE {
0014 namespace version_conversion {
0015 
0016 class BatchNormalization_13_14 final : public Adapter {
0017  public:
0018   explicit BatchNormalization_13_14() : Adapter("BatchNormalization", OpSetID(13), OpSetID(14)) {}
0019 
0020   void adapt_batch_normalization_13_14(Node* node) const {
0021     ONNX_ASSERTM(
0022         node->outputs().size() < 4,
0023         "BatchNormalization outputs 4 and 5 are not "
0024         "supported in Opset 14.");
0025   }
0026 
0027   Node* adapt(std::shared_ptr<Graph>, Node* node) const override {
0028     adapt_batch_normalization_13_14(node);
0029     return node;
0030   }
0031 };
0032 
0033 } // namespace version_conversion
0034 } // namespace ONNX_NAMESPACE