onnxruntime/onnxruntime/core/graph/function_impl.h
Changming Sun 109b3cb450
Avoid using the default logger in the graph lib and optimizers (#2361)
1. Use the session logger if it is available.
2. Don't disable warning 4100 globally. We should fix the warnings instead of disabling it.
2019-11-14 13:23:28 -08:00

46 lines
1.3 KiB
C++

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#pragma once
#include "core/common/logging/logging.h"
#include "core/graph/function.h"
#include "core/graph/model.h"
namespace onnxruntime {
class Graph;
class Node;
} // namespace onnxruntime
namespace onnxruntime {
// Function representation class.
class FunctionImpl final : public Function {
public:
FunctionImpl(const onnxruntime::Graph& graph,
std::unique_ptr<IndexedSubGraph> customized_func,
const logging::Logger& logger);
FunctionImpl(const onnxruntime::Graph& graph,
const onnxruntime::NodeIndex& node_index,
const ONNX_NAMESPACE::FunctionProto& onnx_func,
const logging::Logger& logger);
~FunctionImpl() override;
const ONNX_NAMESPACE::OpSchema& OpSchema() const override;
const onnxruntime::Graph& Body() const override;
const IndexedSubGraph& GetIndexedSubGraph() const override;
const ONNX_NAMESPACE::FunctionProto* GetFuncProto() const;
private:
const onnxruntime::Graph* const parent_graph_;
std::unique_ptr<IndexedSubGraph> customized_func_body_;
std::unique_ptr<ONNX_NAMESPACE::OpSchema> op_schema_;
onnxruntime::Model body_;
ONNX_NAMESPACE::FunctionProto onnx_func_proto_;
};
} // namespace onnxruntime