-
Notifications
You must be signed in to change notification settings - Fork 855
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The CI sync from the upstream TF has been failing for the last month due to the relocation of certain TFLite files. In particular, some schema files were relocated to tensorflow/compiler/mlir/lite subfolder. This PR mirrors the migration and adds a few redirection headers to ensure source compatibility for now. This PR also includes a TF sync as well to get us caught up again. While that could have been done separately, this is done together to ensure everything continues to build with the relocations. BUG=b/351824449
- Loading branch information
Showing
17 changed files
with
187 additions
and
58 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
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
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,10 @@ | ||
package( | ||
default_visibility = ["//visibility:public"], | ||
licenses = ["notice"], | ||
) | ||
|
||
cc_library( | ||
name = "compatibility_macros", | ||
hdrs = ["compatibility_macros.h"], | ||
deps = ["//tensorflow/lite/kernels/internal:compatibility"], | ||
) |
21 changes: 21 additions & 0 deletions
21
tensorflow/compiler/mlir/lite/kernels/internal/compatibility_macros.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,21 @@ | ||
/* Copyright 2024 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. | ||
==============================================================================*/ | ||
|
||
#ifndef TENSORFLOW_COMPILER_MLIR_LITE_KERNELS_INTERNAL_COMPATABILITY_MACROS_H_ | ||
#define TENSORFLOW_COMPILER_MLIR_LITE_KERNELS_INTERNAL_COMPATABILITY_MACROS_H_ | ||
|
||
#include "tensorflow/lite/kernels/internal/compatibility.h" // IWYU pragma: keep | ||
|
||
#endif // TENSORFLOW_COMPILER_MLIR_LITE_KERNELS_INTERNAL_COMPATABILITY_MACROS_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,41 @@ | ||
load("@flatbuffers//:build_defs.bzl", "flatbuffer_cc_library") | ||
|
||
package( | ||
default_visibility = [ | ||
"//visibility:public", | ||
], | ||
licenses = ["notice"], | ||
) | ||
|
||
exports_files( | ||
srcs = ["schema.fbs"], | ||
) | ||
|
||
flatbuffer_cc_library( | ||
name = "schema_fbs", | ||
srcs = ["schema.fbs"], | ||
) | ||
|
||
# Generic schema for inference on device (but with reflections makes bigger). | ||
flatbuffer_cc_library( | ||
name = "schema_fbs_with_reflection", | ||
srcs = ["schema.fbs"], | ||
flatc_args = [ | ||
"--reflect-types", | ||
"--reflect-names", | ||
"--no-union-value-namespacing", | ||
"--gen-object-api", | ||
], | ||
out_prefix = "reflection/", | ||
) | ||
|
||
cc_library( | ||
name = "schema_utils", | ||
srcs = ["schema_utils.cc"], | ||
hdrs = ["schema_utils.h"], | ||
deps = [ | ||
":schema_fbs", | ||
"//tensorflow/compiler/mlir/lite/kernels/internal:compatibility_macros", | ||
"@flatbuffers//:runtime_cc", | ||
], | ||
) |
File renamed without changes.
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,22 @@ | ||
/* Copyright 2024 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. | ||
==============================================================================*/ | ||
#ifndef TENSORFLOW_COMPILER_MLIR_LITE_SCHEMA_SCHEMA_GENERATED_H_ | ||
#define TENSORFLOW_COMPILER_MLIR_LITE_SCHEMA_SCHEMA_GENERATED_H_ | ||
|
||
// This file should only be used by the make build to redirect schema_utils.cc | ||
// usage of the generated schema to the proper location. | ||
#include "tensorflow/lite/schema/schema_generated.h" // IWYU pragma: keep | ||
|
||
#endif // TENSORFLOW_LITE_SCHEMA_SCHEMA_UTILS_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
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,33 @@ | ||
/* Copyright 2020 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. | ||
==============================================================================*/ | ||
#ifndef TENSORFLOW_COMPILER_MLIR_LITE_SCHEMA_SCHEMA_UTILS_H_ | ||
#define TENSORFLOW_COMPILER_MLIR_LITE_SCHEMA_SCHEMA_UTILS_H_ | ||
|
||
#include "flatbuffers/flatbuffers.h" | ||
#include "tensorflow/compiler/mlir/lite/schema/schema_generated.h" | ||
|
||
namespace tflite { | ||
|
||
// The following methods are introduced to resolve op builtin code shortage | ||
// problem. The new builtin operator will be assigned to the extended builtin | ||
// code field in the flatbuffer schema. Those methods helps to hide builtin code | ||
// details. | ||
BuiltinOperator GetBuiltinCode(const OperatorCode *op_code); | ||
|
||
BuiltinOperator GetBuiltinCode(const OperatorCodeT *op_code); | ||
|
||
} // namespace tflite | ||
|
||
#endif // TENSORFLOW_COMPILER_MLIR_LITE_SCHEMA_SCHEMA_UTILS_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
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
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
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
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
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
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
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