Unverified Commit f91b59c6 authored by thunderfyc's avatar thunderfyc Committed by GitHub
Browse files

Initial checkin of sequence_projection (#9153)



* Initial checkin of sequence_projection

* Fix the path

* Fix paths and deps

* Fix path and deps
Co-authored-by: default avatarLearn2Compress <expander-robot@google.com>
parent 67efd3ab
# TFLite ops for sequence string projection.
load("@org_tensorflow//tensorflow/lite:build_def.bzl", "tflite_copts")
licenses(["notice"])
package(
default_visibility = [
"//:__subpackages__", # sequence projection
],
)
cc_library(
name = "sequence_string_projection",
srcs = ["sequence_string_projection.cc"],
hdrs = ["sequence_string_projection.h"],
copts = tflite_copts(),
deps = [
":quantization_util",
"@org_tensorflow//tensorflow/lite:string_util",
"@org_tensorflow//tensorflow/lite/kernels:builtin_ops",
"///tf_ops:projection_normalizer_util", # sequence projection
"///tf_ops:projection_util", # sequence projection
"@flatbuffers",
],
alwayslink = 1,
)
cc_test(
name = "sequence_string_projection_test",
size = "small",
srcs = ["sequence_string_projection_test.cc"],
deps = [
":sequence_string_projection",
":tf_tflite_diff_test_util",
"@org_tensorflow//tensorflow/lite:framework",
"@org_tensorflow//tensorflow/lite:string_util",
"@org_tensorflow//tensorflow/lite/core/api",
"@org_tensorflow//tensorflow/lite/kernels:builtin_ops",
"@org_tensorflow//tensorflow/lite/kernels:test_util",
"///tf_ops:sequence_string_projection_op", # sequence projection
"///tf_ops:sequence_string_projection_op_v2", # sequence projection
"@flatbuffers",
],
)
cc_library(
name = "tf_tflite_diff_test_util",
testonly = 1,
srcs = ["tf_tflite_diff_test_util.cc"],
hdrs = ["tf_tflite_diff_test_util.h"],
deps = [
"@org_tensorflow//tensorflow/core:framework",
"@org_tensorflow//tensorflow/core:lib",
"@org_tensorflow//tensorflow/core:test",
"@org_tensorflow//tensorflow/core/kernels:ops_testutil",
"@org_tensorflow//tensorflow/lite/kernels:test_util",
"@com_google_absl//absl/container:flat_hash_map",
"@flatbuffers",
],
)
cc_library(
name = "quantization_util",
hdrs = ["quantization_util.h"],
deps = ["@org_tensorflow//tensorflow/lite:context"],
)
cc_library(
name = "expected_value",
srcs = ["expected_value.cc"],
hdrs = ["expected_value.h"],
copts = tflite_copts(),
deps = [
":quantization_util",
"@org_tensorflow//tensorflow/lite/kernels:builtin_ops",
],
alwayslink = 1,
)
This diff is collapsed.
/* 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_MODELS_SEQUENCE_PROJECTION_TFLITE_OPS_EXPECTED_VALUE_H_
#define TENSORFLOW_MODELS_SEQUENCE_PROJECTION_TFLITE_OPS_EXPECTED_VALUE_H_
#include "tensorflow/lite/kernels/register.h"
namespace tflite {
namespace ops {
namespace custom {
TfLiteRegistration* Register_EXPECTED_VALUE();
} // namespace custom
} // namespace ops
} // namespace tflite
#endif // TENSORFLOW_MODELS_SEQUENCE_PROJECTION_TFLITE_OPS_EXPECTED_VALUE_H_
This diff is collapsed.
/* 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_MODELS_SEQUENCE_PROJECTION_TFLITE_OPS_SEQUENCE_STRING_PROJECTION_H_
#define TENSORFLOW_MODELS_SEQUENCE_PROJECTION_TFLITE_OPS_SEQUENCE_STRING_PROJECTION_H_
#include "tensorflow/lite/kernels/register.h"
namespace tflite {
namespace ops {
namespace custom {
extern const char kSequenceStringProjection[];
TfLiteRegistration* Register_SEQUENCE_STRING_PROJECTION();
extern const char kSequenceStringProjectionV2[];
TfLiteRegistration* Register_SEQUENCE_STRING_PROJECTION_V2();
} // namespace custom
} // namespace ops
} // namespace tflite
#endif // TENSORFLOW_MODELS_SEQUENCE_PROJECTION_TFLITE_OPS_SEQUENCE_STRING_PROJECTION_H_
# Placeholder to make bazel treat it as a package.
"""Set up configurable Android SDK and NDK dependencies."""
def android_workspace():
# String for replacement in Bazel template.
# These will either be replaced by android_sdk_repository if various ENV
# variables are set when `local_config_android` repo_rule is run, or they
# will be replaced by noops otherwise.
MAYBE_ANDROID_SDK_REPOSITORY
MAYBE_ANDROID_NDK_REPOSITORY
This diff is collapsed.
This diff is collapsed.
# This empty BUILD file is required to make Bazel treat this directory as a package.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment