import_model.cc
imports tensorflow/core/platform/env.himports tensorflow/core/platform/status.h
SHA-256780a3e0263ec1c75369c8b34e6a5763cfa4ec3e6cf45700fac72e6c33304404e
MaleculeMd(In₆)
Evidence
1/* Copyright 2021 The TensorFlow Authors. All Rights Reserved.
2
3Licensed under the Apache License, Version 2.0 (the "License");
4you may not use this file except in compliance with the License.
5You may obtain a copy of the License at
6
7 http://www.apache.org/licenses/LICENSE-2.0
8
9Unless required by applicable law or agreed to in writing, software
10distributed under the License is …
11:42… IND, either express or implied.
12See the License for the specific language governing permissions and
13limitations under the License.
14==============================================================================*/
15
16#include "tensorflow/compiler/mlir/tfrt/translate/import_model.h"
17
18#include <cstdint>
19#include <deque>
20#include <memory>
21#include <string>
22#include <vector>
23
24#include "absl/container/flat_hash_set.h"
25#include "absl/functional/function_ref.h"
26#include "absl/log/log.h"
27#include "absl/status/status.h"
28#include "absl/strings/str_cat.h"
29#include "absl/strings/string_view.h"
30#include "mlir/Dialect/Func/Extensions/AllExtensions.h" // from @llvm-project
31#include "mlir/Dialect/Func/IR/FuncOps.h" // from @llvm-project
32#include "mlir/IR/Attributes.h" // from @llvm-project
33#include "mlir/IR/Builders.h" // from @llvm-project
34#include "mlir/IR/BuiltinAttributes.h" // from @llvm-project
35#include "mlir/IR/DialectRegistry.h" // from @llvm-project
36#include "mlir/IR/MLIRContext.h" // from @llvm-project
37#include "mlir/IR/Operation.h" // from @llvm-project
38#include "mlir/IR/SymbolTable.h" // from @llvm-project
39#include "mlir/Support/LLVM.h" // from @llvm-project
40#include "mlir/Support/LogicalResult.h" // from @llvm-project
41#include "tensorflow/compiler/mlir/tensorflow/ir/tf_ops.h"
42#include "tensorflow/compiler/mlir/tensorflow/transforms/host_runtime/lower_cluster_to_runtime_ops.h"
43#include "tensorflow/compiler/mlir/tensorflow/transforms/passes.h"
44#include "tensorflow/compiler/mlir/tensorflow/transforms/tf_saved_model_asset_sinking_pass.h"
45#include "tensorflow/compiler/mlir/tensorflow/translate/mlir_roundtrip_flags.h"
46#include "tensorflow/compiler/mlir/tensorflow/utils/dump_mlir_util.h"
47#include "tensorflow/compiler/mlir/tensorflow/utils/error_util.h"
48#include "tensorflow/compiler/mlir/tensorflow/utils/serialize_mlir_module_utils.h"
49#include "tensorflow/compiler/mlir/tf2xla/api/v2/cluster_tf.h"
50#include "tensorflow/compiler/mlir/tf2xla/api/v2/tf_dialect_to_executor.h"
51#include "tensorflow/compiler/mlir/tf2xla/api/v2/tf_executor_to_graph.h"
52#include "tensorflow/compiler/mlir/tfrt/backend_compiler.h"
53#include "tensorflow/compiler/mlir/tfrt/function/function.h"
54#include "tensorflow/compiler/mlir/tfrt/transforms/passes.h"
55#include "tensorflow/compiler/mlir/tfrt/transforms/tfrt_pipeline_options.h"
56#include "tensorflow/compiler/mlir/tfrt/transforms/tpu_passes.h"
57#include "tensorflow/compiler/mlir/tfrt/translate/tfrt_compile_options.h"
58#include "tensorflow/compiler/tf2xla/xla_op_registry.h"
135:80… n
136 // CPU. This is because bridge guarantees that each function has only one
137 // use. We don't replace the uses of the function, because we it …
138:2… // the root caller and hence its uses should have been removed.
139 func_op->erase();
140
141 visited.insert(func_name);
142 }
143 return xla_func_defs; …