-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[circle-mlir/import] Introduce CircleImport
This will introduce CircleImport to import circle mode files. Code itself is from Tensorflow flatbuffer_import.cc with little modification and removed that are not necessary at this moment. ONE-DCO-1.0-Signed-off-by: SaeHie Park <[email protected]>
- Loading branch information
1 parent
f008c28
commit 63e23b4
Showing
3 changed files
with
1,128 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
set(SRC | ||
src/CircleImport.cpp | ||
src/CircleOperator.cpp | ||
) | ||
|
||
|
47 changes: 47 additions & 0 deletions
47
circle-mlir/circle-mlir/lib/import/include/circle-mlir/import/CircleImport.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Copyright (c) 2025 Samsung Electronics Co., Ltd. All Rights Reserved | ||
* Copyright 2019 The TensorFlow Authors. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
// from tensorflow/compiler/mlir/lite/flatbuffer_import.h | ||
|
||
#ifndef __CIRCLE_MLIR_IMPORT_CIRCLE_IMPORT_H__ | ||
#define __CIRCLE_MLIR_IMPORT_CIRCLE_IMPORT_H__ | ||
|
||
#include <string> | ||
#include <vector> | ||
|
||
#include <absl/strings/string_view.h> | ||
#include <mlir/Dialect/Func/IR/FuncOps.h> | ||
#include <mlir/IR/BuiltinOps.h> | ||
#include <mlir/IR/Location.h> | ||
#include <mlir/IR/MLIRContext.h> | ||
|
||
namespace mlir | ||
{ | ||
namespace Circle | ||
{ | ||
|
||
mlir::OwningOpRef<mlir::ModuleOp> | ||
FlatBufferToMlir(absl::string_view buffer, mlir::MLIRContext *context, mlir::Location base_loc, | ||
bool use_external_constant = false, | ||
const std::vector<std::string> &ordered_input_arrays = {}, | ||
const std::vector<std::string> &ordered_output_arrays = {}, | ||
bool experimental_prune_unreachable_nodes_unconditionally = false); | ||
|
||
} // namespace Circle | ||
} // namespace mlir | ||
|
||
#endif // __CIRCLE_MLIR_IMPORT_CIRCLE_IMPORT_H__ |
Oops, something went wrong.