mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-05 04:17:53 +00:00
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.
26 lines
859 B
C++
26 lines
859 B
C++
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
// Licensed under the MIT License.
|
|
|
|
#include "core/optimizer/graph_transformer.h"
|
|
|
|
using namespace ::onnxruntime::common;
|
|
|
|
namespace onnxruntime {
|
|
|
|
Status GraphTransformer::Apply(Graph& graph, bool& modified, const logging::Logger& logger) const {
|
|
// the Graph should be in a good state prior this being called, so there should be no need to call Resolve here
|
|
// ORT_RETURN_IF_ERROR(graph.Resolve());
|
|
|
|
auto status = ApplyImpl(graph, modified, 0, logger);
|
|
ORT_RETURN_IF_ERROR(status);
|
|
|
|
// At least currently, some transformers (InsertCastTransformer and MemcpyTransformer) need this to be called
|
|
// after they complete to put the graph back into a valid state for the next transformer.
|
|
if (modified) {
|
|
status = graph.Resolve();
|
|
}
|
|
|
|
return status;
|
|
}
|
|
|
|
} // namespace onnxruntime
|