diff --git a/tensorflow/contrib/tensorrt/BUILD b/tensorflow/contrib/tensorrt/BUILD index d29ecbb2e6a..bcd3c8c547f 100644 --- a/tensorflow/contrib/tensorrt/BUILD +++ b/tensorflow/contrib/tensorrt/BUILD @@ -9,7 +9,6 @@ licenses(["notice"]) # Apache 2.0 exports_files(["LICENSE"]) -load("@local_config_cuda//cuda:build_defs.bzl", "if_cuda") load( "//tensorflow:tensorflow.bzl", "tf_custom_op_library", diff --git a/third_party/gpus/cuda_configure.bzl b/third_party/gpus/cuda_configure.bzl index e23a533716a..b7c47a19ddc 100644 --- a/third_party/gpus/cuda_configure.bzl +++ b/third_party/gpus/cuda_configure.bzl @@ -367,19 +367,19 @@ def find_cuda_define(repository_ctx, header_dir, header_file, define): if result.stdout.find(define) == -1: auto_configure_fail("Cannot find line containing '%s' in %s" % (define, h_path)) - #split results to lines + # Split results to lines lines = result.stdout.split('\n') - lenLines = len(lines) - for l in range(lenLines): + num_lines = len(lines) + for l in range(num_lines): line = lines[l] - if define in line: # find the line with define + if define in line: # Find the line with define version = line - if l != lenLines-1 and line[-1] == '\\': # add next line, if multiline + if l != num_lines-1 and line[-1] == '\\': # Add next line, if multiline version = version[:-1] + lines[l+1] break - #remove any comments + # Remove any comments version = version.split("//")[0] - # remove define name + # Remove define name version = version.replace(define, "").strip() # Remove the code after the version number. version_end = version.find(" ") diff --git a/third_party/tensorrt/BUILD.tpl b/third_party/tensorrt/BUILD.tpl index 12d01150913..57682e87350 100644 --- a/third_party/tensorrt/BUILD.tpl +++ b/third_party/tensorrt/BUILD.tpl @@ -1,11 +1,12 @@ # NVIDIA TensorRT # A high-performance deep learning inference optimizer and runtime. -load("@local_config_cuda//cuda:build_defs.bzl", "cuda_default_copts") licenses(["notice"]) exports_files(["LICENSE"]) +load("@local_config_cuda//cuda:build_defs.bzl", "cuda_default_copts") + package(default_visibility = ["//visibility:public"]) cc_library( diff --git a/third_party/tensorrt/tensorrt_configure.bzl b/third_party/tensorrt/tensorrt_configure.bzl index 4a1441500a5..8e76e5d02ae 100644 --- a/third_party/tensorrt/tensorrt_configure.bzl +++ b/third_party/tensorrt/tensorrt_configure.bzl @@ -20,10 +20,7 @@ _TENSORRT_INSTALL_PATH = "TENSORRT_INSTALL_PATH" _TF_TENSORRT_VERSION = "TF_TENSORRT_VERSION" _TF_TENSORRT_LIBS = ["nvinfer"] -_TF_TENSORRT_HEADERS = [ - "NvInfer.h", - "NvUtils.h" -] +_TF_TENSORRT_HEADERS = ["NvInfer.h", "NvUtils.h"] _DEFINE_TENSORRT_SONAME_MAJOR = "#define NV_TENSORRT_SONAME_MAJOR" _DEFINE_TENSORRT_SONAME_MINOR = "#define NV_TENSORRT_SONAME_MINOR"