diff --git a/tflite/c/c_test.c b/tflite/c/c_test.c index aa0e8762..29cd07b5 100644 --- a/tflite/c/c_test.c +++ b/tflite/c/c_test.c @@ -66,7 +66,7 @@ static void TestVersion(void) { static void TestInferenceUsingSignature(void) { TfLiteModel* model = TfLiteModelCreateFromFile( - "third_party/tensorflow/lite/testdata/multi_signatures.bin"); + "tflite/testdata/multi_signatures.bin"); ASSERT_NE(model, NULL); TfLiteInterpreterOptions* options = TfLiteInterpreterOptionsCreate(); @@ -154,7 +154,7 @@ static void TestInferenceUsingSignature(void) { // would invalidate input/output tensors. static void TestRepeatResizeInputTensor(void) { TfLiteModel* model = TfLiteModelCreateFromFile( - "third_party/tensorflow/lite/testdata/multi_signatures.bin"); + "tflite/testdata/multi_signatures.bin"); ASSERT_NE(model, NULL); TfLiteInterpreterOptions* options = TfLiteInterpreterOptionsCreate(); @@ -236,7 +236,7 @@ static void TestRepeatResizeInputTensor(void) { static void TestInferenceUsingInterpreter(void) { TfLiteModel* model = - TfLiteModelCreateFromFile("third_party/tensorflow/lite/testdata/add.bin"); + TfLiteModelCreateFromFile("tflite/testdata/add.bin"); ASSERT_NE(model, NULL); TfLiteInterpreterOptions* options = TfLiteInterpreterOptionsCreate(); @@ -321,7 +321,7 @@ TfLiteStatus PrepareThatChecksExecutionPlanSizeEqualsTwo( static void TestTfLiteOpaqueContextGetExecutionPlan(void) { TfLiteModel* model = - TfLiteModelCreateFromFile("third_party/tensorflow/lite/testdata/add.bin"); + TfLiteModelCreateFromFile("tflite/testdata/add.bin"); // Create and install a delegate instance. bool delegate_prepared = false; @@ -348,7 +348,7 @@ static void TestTfLiteOpaqueContextReportErrorMacros( TfLiteStatus (*Prepare)(TfLiteOpaqueContext* context, TfLiteOpaqueDelegate* delegate, void* data)) { TfLiteModel* model = - TfLiteModelCreateFromFile("third_party/tensorflow/lite/testdata/add.bin"); + TfLiteModelCreateFromFile("tflite/testdata/add.bin"); // Create and install a delegate instance. bool delegate_prepared_called = false; diff --git a/tflite/core/tools/verifier_test.cc b/tflite/core/tools/verifier_test.cc index 13c5d089..17f56ccd 100644 --- a/tflite/core/tools/verifier_test.cc +++ b/tflite/core/tools/verifier_test.cc @@ -41,7 +41,7 @@ namespace tflite { namespace { static const char* kSparseTensorTestModel = - "tensorflow/lite/testdata/sparse_tensor.bin"; + "tflite/testdata/sparse_tensor.bin"; } // namespace class MockErrorReporter : public ErrorReporter { diff --git a/tflite/delegates/opaque_delegate_test.cc b/tflite/delegates/opaque_delegate_test.cc index 34bb3e82..055e24c0 100644 --- a/tflite/delegates/opaque_delegate_test.cc +++ b/tflite/delegates/opaque_delegate_test.cc @@ -229,7 +229,7 @@ TEST_F(TestOpaqueMacros, TF_LITE_OPAQUE_ENSURE_REPORTS) { }; EnsureDelegationFails(); const std::string txt_regex( - ".*third_party/tensorflow/lite/delegates/" + ".*tflite/delegates/" "opaque_delegate_test\\.cc.*false was not true.*"); #ifndef TF_LITE_STRIP_ERROR_STRINGS EXPECT_THAT(reporter_.error_messages(), ContainsRegex(txt_regex)); @@ -246,7 +246,7 @@ TEST_F(TestOpaqueMacros, TF_LITE_OPAQUE_ENSURE_SILENT) { }; EnsureDelegationSucceeds(); const std::string txt_regex( - ".*third_party/tensorflow/lite/delegates/" + ".*tflite/delegates/" "opaque_delegate_test\\.cc.*was not true.*"); EXPECT_THAT(reporter_.error_messages(), Not(ContainsRegex(txt_regex))); } @@ -259,7 +259,7 @@ TEST_F(TestOpaqueMacros, TF_LITE_OPAQUE_ENSURE_EQ_REPORTS) { }; EnsureDelegationFails(); const std::string txt_regex( - ".*third_party/tensorflow/lite/delegates/" + ".*tflite/delegates/" "opaque_delegate_test\\.cc.*true != false.*"); #ifndef TF_LITE_STRIP_ERROR_STRINGS EXPECT_THAT(reporter_.error_messages(), ContainsRegex(txt_regex)); @@ -276,7 +276,7 @@ TEST_F(TestOpaqueMacros, TF_LITE_OPAQUE_ENSURE_EQ_SILENT) { }; EnsureDelegationSucceeds(); const std::string txt_regex( - ".*third_party/tensorflow/lite/delegates/" + ".*tflite/delegates/" "opaque_delegate_test\\.cc.* != *"); EXPECT_THAT(reporter_.error_messages(), Not(ContainsRegex(txt_regex))); } @@ -289,7 +289,7 @@ TEST_F(TestOpaqueMacros, TF_LITE_OPAQUE_ENSURE_MSG_REPORTS) { }; EnsureDelegationFails(); const std::string txt_regex( - ".*third_party/tensorflow/lite/delegates/" + ".*tflite/delegates/" "opaque_delegate_test\\.cc.*custom error msg.*"); #ifndef TF_LITE_STRIP_ERROR_STRINGS EXPECT_THAT(reporter_.error_messages(), ContainsRegex(txt_regex)); @@ -306,7 +306,7 @@ TEST_F(TestOpaqueMacros, TF_LITE_OPAQUE_ENSURE_MSG_SILENT) { }; EnsureDelegationSucceeds(); const std::string txt_regex( - ".*third_party/tensorflow/lite/delegates/" + ".*tflite/delegates/" "opaque_delegate_test\\.cc.*"); EXPECT_THAT(reporter_.error_messages(), Not(ContainsRegex(txt_regex))); } @@ -320,7 +320,7 @@ TEST_F(TestOpaqueMacros, TF_LITE_OPAQUE_ENSURE_TYPES_EQ_REPORTS) { }; EnsureDelegationFails(); const std::string txt_regex( - ".*third_party/tensorflow/lite/delegates/" + ".*tflite/delegates/" "opaque_delegate_test\\.cc.*kTfLiteFloat32 != kTfLiteInt32.*"); #ifndef TF_LITE_STRIP_ERROR_STRINGS EXPECT_THAT(reporter_.error_messages(), ContainsRegex(txt_regex)); @@ -338,7 +338,7 @@ TEST_F(TestOpaqueMacros, TF_LITE_OPAQUE_ENSURE_TYPES_EQ_SILENT) { }; EnsureDelegationSucceeds(); const std::string txt_regex( - ".*third_party/tensorflow/lite/delegates/" + ".*tflite/delegates/" "opaque_delegate_test\\.cc.*!=.*"); EXPECT_THAT(reporter_.error_messages(), Not(ContainsRegex(txt_regex))); } @@ -351,7 +351,7 @@ TEST_F(TestOpaqueMacros, TF_LITE_OPAQUE_ENSURE_NEAR_REPORTS) { }; EnsureDelegationFails(); const std::string txt_regex( - ".*third_party/tensorflow/lite/delegates/" + ".*tflite/delegates/" "opaque_delegate_test\\.cc.*1 not near 10.*"); #ifndef TF_LITE_STRIP_ERROR_STRINGS EXPECT_THAT(reporter_.error_messages(), ContainsRegex(txt_regex)); @@ -368,7 +368,7 @@ TEST_F(TestOpaqueMacros, TF_LITE_OPAQUE_ENSURE_NEAR_SILENT) { }; EnsureDelegationSucceeds(); const std::string txt_regex( - ".*third_party/tensorflow/lite/delegates/" + ".*tflite/delegates/" "opaque_delegate_test\\.cc.*10 not near 10.*"); EXPECT_THAT(reporter_.error_messages(), Not(ContainsRegex(txt_regex))); } diff --git a/tflite/delegates/utils/experimental/sample_stable_delegate/BUILD b/tflite/delegates/utils/experimental/sample_stable_delegate/BUILD index e36beeb8..edb51a44 100644 --- a/tflite/delegates/utils/experimental/sample_stable_delegate/BUILD +++ b/tflite/delegates/utils/experimental/sample_stable_delegate/BUILD @@ -153,7 +153,7 @@ genrule( echo ' { "stable_delegate_loader_settings": { - "delegate_path": "tensorflow/lite/delegates/utils/experimental/sample_stable_delegate/libtensorflowlite_sample_stable_delegate.so" + "delegate_path": "tflite/delegates/utils/experimental/sample_stable_delegate/libtensorflowlite_sample_stable_delegate.so" } } ' > $@ diff --git a/tflite/delegates/utils/experimental/sample_stable_delegate/sample_app_using_stable_delegate.cc b/tflite/delegates/utils/experimental/sample_stable_delegate/sample_app_using_stable_delegate.cc index 97958ffa..76f47644 100644 --- a/tflite/delegates/utils/experimental/sample_stable_delegate/sample_app_using_stable_delegate.cc +++ b/tflite/delegates/utils/experimental/sample_stable_delegate/sample_app_using_stable_delegate.cc @@ -69,7 +69,7 @@ int main(int argc, char* argv[]) { // Load the example stable delegate plugin from a shared library file. const TfLiteStableDelegate* stable_delegate_handle = LoadDelegateFromSharedLibrary( - "tensorflow/lite/delegates/utils/experimental/" + "tflite/delegates/utils/experimental/" "sample_stable_delegate/libtensorflowlite_sample_stable_delegate.so"); CHECK(stable_delegate_handle != nullptr); diff --git a/tflite/java/aar_with_jni.bzl b/tflite/java/aar_with_jni.bzl index 20352c8e..1493eec3 100644 --- a/tflite/java/aar_with_jni.bzl +++ b/tflite/java/aar_with_jni.bzl @@ -69,7 +69,7 @@ cd $$(mktemp -d) unzip $$origdir/$(location :{1}_dummy_app_for_so_unsigned.apk) "lib/*" cp -r lib jni zip -r $$origdir/$(location :{1}.aar) jni/*/*.so -cp $$origdir/$(location @org_tensorflow//:LICENSE) ./ +cp $$origdir/$(location @org_tensorflow//tensorflow:LICENSE) ./ zip $$origdir/$(location :{1}.aar) LICENSE """.format(android_library, name) @@ -128,7 +128,7 @@ cp $(location {0}.aar) $(location :{1}.aar) chmod +w $(location :{1}.aar) origdir=$$PWD cd $$(mktemp -d) -cp $$origdir/$(location @org_tensorflow//:LICENSE) ./ +cp $$origdir/$(location @org_tensorflow//tensorflow:LICENSE) ./ zip $$origdir/$(location :{1}.aar) LICENSE """.format(android_library, name) diff --git a/tflite/testing/tflite_driver_test.cc b/tflite/testing/tflite_driver_test.cc index a1c6d586..3f31cef7 100644 --- a/tflite/testing/tflite_driver_test.cc +++ b/tflite/testing/tflite_driver_test.cc @@ -29,7 +29,7 @@ using ::testing::ElementsAre; TEST(TfliteDriverTest, SimpleTest) { std::unique_ptr runner(new TfLiteDriver); - runner->SetModelBaseDir("third_party/tensorflow/lite"); + runner->SetModelBaseDir("tflite"); runner->LoadModel("testdata/multi_add.bin", "serving_default"); ASSERT_TRUE(runner->IsValid()); @@ -62,7 +62,7 @@ TEST(TfliteDriverTest, SingleAddOpTest) { /*delegate_type=*/TfLiteDriver::DelegateType::kNone, /*reference_kernel=*/true)); - runner->SetModelBaseDir("third_party/tensorflow/lite"); + runner->SetModelBaseDir("tflite"); runner->LoadModel("testdata/multi_add.bin"); ASSERT_TRUE(runner->IsValid()); @@ -91,7 +91,7 @@ TEST(TfliteDriverTest, AddOpWithNaNTest) { /*delegate_type=*/TfLiteDriver::DelegateType::kNone, /*reference_kernel=*/true)); - runner->SetModelBaseDir("third_party/tensorflow/lite"); + runner->SetModelBaseDir("tflite"); runner->LoadModel("testdata/multi_add.bin"); ASSERT_TRUE(runner->IsValid()); @@ -119,7 +119,7 @@ TEST(TfliteDriverTest, AddOpWithNaNTest) { TEST(TfliteDriverTest, AddQuantizedInt8Test) { std::unique_ptr runner(new TfLiteDriver()); - runner->SetModelBaseDir("third_party/tensorflow/lite"); + runner->SetModelBaseDir("tflite"); runner->LoadModel("testdata/add_quantized_int8.bin"); ASSERT_TRUE(runner->IsValid()); diff --git a/tflite/toco/toco_port_test.cc b/tflite/toco/toco_port_test.cc index 6b71acba..f4ce5e7f 100644 --- a/tflite/toco/toco_port_test.cc +++ b/tflite/toco/toco_port_test.cc @@ -24,9 +24,9 @@ namespace port { namespace { #ifdef PLATFORM_GOOGLE -#define TFLITE_PREFIX "tflite/" +#define TFLITE_PREFIX "third_party/tensorflow/lite/" #else -#define TFLITE_PREFIX "tensorflow/lite/" +#define TFLITE_PREFIX "tflite/" #endif TEST(TocoPortTest, Exists) { diff --git a/tflite/tools/delegates/experimental/stable_delegate/test_sample_stable_delegate_settings.json b/tflite/tools/delegates/experimental/stable_delegate/test_sample_stable_delegate_settings.json index e3f66505..5a655676 100755 --- a/tflite/tools/delegates/experimental/stable_delegate/test_sample_stable_delegate_settings.json +++ b/tflite/tools/delegates/experimental/stable_delegate/test_sample_stable_delegate_settings.json @@ -6,6 +6,6 @@ { "delegate": "NONE", "stable_delegate_loader_settings": { - "delegate_path": "tensorflow/lite/delegates/utils/experimental/sample_stable_delegate/libtensorflowlite_sample_stable_delegate.so" + "delegate_path": "tflite/delegates/utils/experimental/sample_stable_delegate/libtensorflowlite_sample_stable_delegate.so" } } diff --git a/tflite/tools/delegates/experimental/stable_delegate/test_stable_xnnpack_settings.json b/tflite/tools/delegates/experimental/stable_delegate/test_stable_xnnpack_settings.json index dfb55657..135a9d5f 100755 --- a/tflite/tools/delegates/experimental/stable_delegate/test_stable_xnnpack_settings.json +++ b/tflite/tools/delegates/experimental/stable_delegate/test_stable_xnnpack_settings.json @@ -6,7 +6,7 @@ { "delegate": "XNNPACK", "stable_delegate_loader_settings": { - "delegate_path": "tensorflow/lite/delegates/utils/experimental/stable_delegate/libtensorflowlite_stable_xnnpack_delegate.so" + "delegate_path": "tflite/delegates/utils/experimental/stable_delegate/libtensorflowlite_stable_xnnpack_delegate.so" }, "xnnpack_settings": { "num_threads": 5 diff --git a/tflite/tools/list_flex_ops_test.cc b/tflite/tools/list_flex_ops_test.cc index 7842a170..31457ffe 100644 --- a/tflite/tools/list_flex_ops_test.cc +++ b/tflite/tools/list_flex_ops_test.cc @@ -87,29 +87,29 @@ class FlexOpModel : public SingleOpModel { }; TEST_F(FlexOpsListTest, TestModelsNoFlex) { - ReadOps("tensorflow/lite/testdata/test_model.bin"); + ReadOps("tflite/testdata/test_model.bin"); EXPECT_EQ(output_text_, "[]\n"); } TEST_F(FlexOpsListTest, TestBrokenModel) { EXPECT_DEATH_IF_SUPPORTED( - ReadOps("tensorflow/lite/testdata/test_model_broken.bin"), ""); + ReadOps("tflite/testdata/test_model_broken.bin"), ""); } TEST_F(FlexOpsListTest, TestZeroSubgraphs) { - ReadOps("tensorflow/lite/testdata/0_subgraphs.bin"); + ReadOps("tflite/testdata/0_subgraphs.bin"); EXPECT_EQ(output_text_, "[]\n"); } TEST_F(FlexOpsListTest, TestFlexAdd) { - ReadOps("tensorflow/lite/testdata/multi_add_flex.bin"); + ReadOps("tflite/testdata/multi_add_flex.bin"); EXPECT_EQ(output_text_, "[[\"AddV2\",\"BinaryOp>\"]]\n"); } TEST_F(FlexOpsListTest, TestTwoModel) { - ReadOps("tensorflow/lite/testdata/multi_add_flex.bin"); - ReadOps("tensorflow/lite/testdata/softplus_flex.bin"); + ReadOps("tflite/testdata/multi_add_flex.bin"); + ReadOps("tflite/testdata/softplus_flex.bin"); EXPECT_EQ(output_text_, "[[\"AddV2\",\"BinaryOp>\"],[\"Softplus\",\"SoftplusOp>\"]]\n"); } diff --git a/tflite/tools/optimize/BUILD b/tflite/tools/optimize/BUILD index 1727e85b..c55f4cba 100644 --- a/tflite/tools/optimize/BUILD +++ b/tflite/tools/optimize/BUILD @@ -231,7 +231,7 @@ tf_cc_test( name = "quantization_utils_test", srcs = ["quantization_utils_test.cc"], args = [ - "--test_model_file=$(location //tensorflow/compiler/mlir/lite/quantization/lite:testdata/single_conv_weights_min_0_max_plus_10.bin)", + "--test_model_file=$(location @org_tensorflow//tensorflow/compiler/mlir/lite/quantization/lite:testdata/single_conv_weights_min_0_max_plus_10.bin)", ], data = [ "@org_tensorflow//tensorflow/compiler/mlir/lite/quantization/lite:testdata/single_conv_weights_min_0_max_plus_10.bin", @@ -282,7 +282,7 @@ tf_cc_test( name = "quantize_model_test", srcs = ["quantize_model_test.cc"], args = [ - "--test_model_file=$(location //tensorflow/compiler/mlir/lite/quantization/lite:testdata/single_conv_weights_min_0_max_plus_10.bin)", + "--test_model_file=$(location @org_tensorflow//tensorflow/compiler/mlir/lite/quantization/lite:testdata/single_conv_weights_min_0_max_plus_10.bin)", ], data = [ "@org_tensorflow//tensorflow/compiler/mlir/lite/quantization/lite:testdata/add_with_const_input.bin", diff --git a/tflite/tools/versioning/gpu_compatibility_test.cc b/tflite/tools/versioning/gpu_compatibility_test.cc index e8079298..a79ab28c 100644 --- a/tflite/tools/versioning/gpu_compatibility_test.cc +++ b/tflite/tools/versioning/gpu_compatibility_test.cc @@ -57,7 +57,7 @@ absl::Status CheckGpuDelegateCompatibility(const tflite::Model* model) { TEST(CheckGpuDelegateCompatibility, Conv2DModel) { const std::string& full_path = tensorflow::GetDataDependencyFilepath( - "tensorflow/lite/testdata/conv_huge_im2col.bin"); + "tflite/testdata/conv_huge_im2col.bin"); auto model = FlatBufferModel::BuildFromFile(full_path.data()); ASSERT_TRUE(model); EXPECT_TRUE(CheckGpuDelegateCompatibility(model->GetModel()).ok()); @@ -65,7 +65,7 @@ TEST(CheckGpuDelegateCompatibility, Conv2DModel) { TEST(CheckGpuDelegateCompatibility, Conv3DModel) { const std::string& full_path = tensorflow::GetDataDependencyFilepath( - "tensorflow/lite/testdata/conv3d_huge_im2col.bin"); + "tflite/testdata/conv3d_huge_im2col.bin"); auto model = FlatBufferModel::BuildFromFile(full_path.data()); ASSERT_TRUE(model); EXPECT_EQ(CheckGpuDelegateCompatibility(model->GetModel()).message(), @@ -74,7 +74,7 @@ TEST(CheckGpuDelegateCompatibility, Conv3DModel) { TEST(CheckGpuDelegateCompatibility, FlexModel) { const std::string& full_path = tensorflow::GetDataDependencyFilepath( - "tensorflow/lite/testdata/multi_add_flex.bin"); + "tflite/testdata/multi_add_flex.bin"); auto model = FlatBufferModel::BuildFromFile(full_path.data()); ASSERT_TRUE(model); EXPECT_EQ(CheckGpuDelegateCompatibility(model->GetModel()).message(), diff --git a/tflite/tools/versioning/op_signature_test.cc b/tflite/tools/versioning/op_signature_test.cc index a7d81be4..b291a103 100644 --- a/tflite/tools/versioning/op_signature_test.cc +++ b/tflite/tools/versioning/op_signature_test.cc @@ -136,7 +136,7 @@ class StubTfLiteContext : public TfLiteContext { TEST(GetOpSignature, FlatBufferModel) { const std::string& full_path = - tensorflow::GetDataDependencyFilepath("tensorflow/lite/testdata/add.bin"); + tensorflow::GetDataDependencyFilepath("tflite/testdata/add.bin"); auto fb_model = FlatBufferModel::BuildFromFile(full_path.data()); ASSERT_TRUE(fb_model); auto model = fb_model->GetModel(); @@ -177,7 +177,7 @@ TEST(GetOpSignature, FlatBufferModel) { free(op_sig.builtin_data); const std::string& full_path3 = tensorflow::GetDataDependencyFilepath( - "tensorflow/lite/testdata/multi_signatures.bin"); + "tflite/testdata/multi_signatures.bin"); auto fb_model3 = FlatBufferModel::BuildFromFile(full_path3.data()); ASSERT_TRUE(fb_model3); auto model3 = fb_model3->GetModel();