saved_model_to_tfl_flatbuffer.cc
imports tensorflow/core/platform/status.himports tensorflow/core/platform/types.h
SHA-25606b2aa72e9b1029be480eed7d714c71ba5bcaae78fdef609e248488c4a1bdf13
MaleculeMd(In₄)
Evidence
1/* Copyright 2022 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#include "tensorflow/compiler/mlir/lite/python/saved_model_to_tfl_flatbuffer.h"
16
17#include <memory>
18#include <optional>
19#include <string>
20#include <unordered_set>
21#include <utility>
22#include <vector>
23
24#include "absl/status/status.h"
25#include "absl/types/span.h"
26#include "llvm/ADT/StringSet.h"
27#include "mlir/Dialect/Func/IR/FuncOps.h" // from @llvm-project
28#include "mlir/IR/BuiltinAttributes.h" // from @llvm-project
29#include "mlir/IR/BuiltinOps.h" // from @llvm-project
30#include "mlir/IR/BuiltinTypes.h" // from @llvm-project
31#include "mlir/IR/MLIRContext.h" // from @llvm-project
32#include "mlir/IR/OwningOpRef.h" // from @llvm-project
33#include "mlir/IR/TypeUtilities.h" // from @llvm-project
34#include "mlir/Support/FileUtilities.h" // from @llvm-project
35#include "mlir/Support/LLVM.h" // from @llvm-project
36#include "tensorflow/compiler/mlir/lite/common/tfl_pass_config.h"
37#include "tensorflow/compiler/mlir/lite/converter_flags.pb.h"
38#include "tensorflow/compiler/mlir/lite/model_flags.pb.h"
39#include "tensorflow/compiler/mlir/lite/python/tf_tfl_flatbuffer_helpers.h"
40#include "tensorflow/compiler/mlir/lite/quantization/common/quantization_lib/quantization_config.h"
41#include "tensorflow/compiler/mlir/lite/tf_to_tfl_flatbuffer.h"
42#include "tensorflow/compiler/mlir/lite/transforms/passes.h"
43#include "tensorflow/compiler/mlir/lite/types.pb.h"
44#include "tensorflow/compiler/mlir/quantization/tensorflow/python/py_function_lib.h"
45#include "tensorflow/compiler/mlir/tensorflow/translate/mlir_roundtrip_flags.h"
46#include "xla/tsl/platform/errors.h"
47#include "xla/tsl/platform/statusor.h"
48#include "tensorflow/core/framework/graph.pb.h"
49#include "tensorflow/core/framework/graph_debug_info.pb.h"
50#include "tensorflow/core/framework/types.pb.h"
51#include "tensorflow/core/lib/core/errors.h"
52#include "tensorflow/core/platform/status.h"
53#include "tensorflow/core/platform/types.h"
54
55namespace tensorflow {
56
57using tensorflow::quantization::PyFunctionLibrary;
58
67:7… // handle such cases if there are any needs for that.
68 if (entry_function != nullptr) {
69 return errors::InvalidArgument(
70 "Th …