diff --git a/onnxruntime/core/optimizer/constant_folding.h b/onnxruntime/core/optimizer/constant_folding.h index 7ce227f86f..423dbeae00 100644 --- a/onnxruntime/core/optimizer/constant_folding.h +++ b/onnxruntime/core/optimizer/constant_folding.h @@ -28,15 +28,19 @@ class ConstantFolding : public GraphTransformer { const InlinedHashSet& compatible_execution_providers = {}, const InlinedHashSet& excluded_initializers = {}) noexcept; - /* Same as above but with a name provided by derived class. - */ +protected: + /** + * Same as the constructor above but with a name provided by derived class. + */ ConstantFolding(const std::string& name, const IExecutionProvider& execution_provider, bool skip_dequantize_linear, const ConfigOptions& config_options, const InlinedHashSet& compatible_execution_providers = {}, const InlinedHashSet& excluded_initializers = {}) noexcept; - + /** + * Derived class can implement this virtual function to limit the nodes that can be constant folded. + */ virtual bool AllowConstantFolding(const Node& node) const { return true; } private: