From 8a1fa9c9bb6cf2f3b92d5bd7f5d4e987f1697467 Mon Sep 17 00:00:00 2001 From: Brian Atkinson Date: Tue, 28 Jan 2020 16:59:56 -0800 Subject: [PATCH] Change to using resource_loader to find in-tree files. PiperOrigin-RevId: 292043928 Change-Id: I4e71326d2daee6fac13e4600cb9f400af10571bb --- .../python/tools/api/generator/output_init_files_test.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tensorflow/python/tools/api/generator/output_init_files_test.py b/tensorflow/python/tools/api/generator/output_init_files_test.py index 7013f007e58..f1f85de868b 100644 --- a/tensorflow/python/tools/api/generator/output_init_files_test.py +++ b/tensorflow/python/tools/api/generator/output_init_files_test.py @@ -25,6 +25,7 @@ import sys from tensorflow import python as _tf_for_api_traversal from tensorflow.lite.python import lite as _tflite_for_api_traversal # pylint: enable=unused-import +from tensorflow.python.platform import resource_loader from tensorflow.python.platform import test from tensorflow.python.util import tf_decorator @@ -158,8 +159,8 @@ class OutputInitFilesTest(test.TestCase): def test_V2_init_files(self): modules = _get_modules( 'tensorflow', '_tf_api_names', '_tf_api_constants') - file_path = ( - 'tensorflow/python/tools/api/generator/api_init_files.bzl') + file_path = resource_loader.get_path_to_datafile( + 'api_init_files.bzl') paths = _get_files_set( file_path, '# BEGIN GENERATED FILES', '# END GENERATED FILES') module_paths = set( @@ -170,8 +171,7 @@ class OutputInitFilesTest(test.TestCase): def test_V1_init_files(self): modules = _get_modules( 'tensorflow', '_tf_api_names_v1', '_tf_api_constants_v1') - file_path = ( - 'tensorflow/python/tools/api/generator/' + file_path = resource_loader.get_path_to_datafile( 'api_init_files_v1.bzl') paths = _get_files_set( file_path, '# BEGIN GENERATED FILES', '# END GENERATED FILES')