Fixes for PR comments and build failures

This commit is contained in:
Sami Kama 2018-02-02 14:36:07 -08:00
parent af4782345c
commit 45fcb8f2d3
6 changed files with 43 additions and 41 deletions

View File

@ -105,8 +105,9 @@ py_library(
"//tensorflow/contrib/training:training_py", "//tensorflow/contrib/training:training_py",
"//tensorflow/contrib/util:util_py", "//tensorflow/contrib/util:util_py",
"//tensorflow/python:util", "//tensorflow/python:util",
] + if_mpi(["//tensorflow/contrib/mpi_collectives:mpi_collectives_py"]) ] + if_mpi(["//tensorflow/contrib/mpi_collectives:mpi_collectives_py"]) + if_tensorrt([
+ if_tensorrt(["//tensorflow/contrib/tensorrt:init_py"]), "//tensorflow/contrib/tensorrt:init_py",
]),
) )

View File

@ -405,6 +405,8 @@ tensorflow/contrib/summary
tensorflow/contrib/tensorboard tensorflow/contrib/tensorboard
tensorflow/contrib/tensorboard/plugins tensorflow/contrib/tensorboard/plugins
tensorflow/contrib/tensorboard/plugins/projector tensorflow/contrib/tensorboard/plugins/projector
# TODO(sami): Add cmake implementations
# tensorflow/contrib/tensorrt/python
tensorflow/contrib/tensor_forest tensorflow/contrib/tensor_forest
tensorflow/contrib/tensor_forest/client tensorflow/contrib/tensor_forest/client
tensorflow/contrib/tensor_forest/hybrid tensorflow/contrib/tensor_forest/hybrid

View File

@ -46,11 +46,11 @@ def CreateInferenceGraph(input_graph_def,
def py2bytes(inp): def py2bytes(inp):
return inp return inp
def py3bytes(inp): def py3bytes(inp):
return inp.encode('utf-8',errors='surrogateescape') return inp.encode('utf-8', errors='surrogateescape')
if _six.PY2: if _six.PY2:
to_bytes=py2bytes to_bytes = py2bytes
else: else:
to_bytes=py3bytes to_bytes = py3bytes
out_names = [] out_names = []
for i in outputs: for i in outputs:

View File

@ -1303,36 +1303,37 @@ def tf_extension_copts():
# This function attempts to append init_module_name to list of # This function attempts to append init_module_name to list of
# exported functions in version script # exported functions in version script
def _append_init_to_versionscript_impl(ctx): def _append_init_to_versionscript_impl(ctx):
modName=ctx.attr.module_name mod_name = ctx.attr.module_name
isVS=ctx.attr.is_version_script if ctx.attr.is_version_script:
if isVS: ctx.actions.expand_template(
ctx.actions.expand_template( template=ctx.file.template_file,
template=ctx.file.template_file, output=ctx.outputs.versionscript,
output=ctx.outputs.versionscript, substitutions={
substitutions={ "global:":"global:\n init_%s;\n PyInit_*;"%(mod_name),
"global:":"global:\n init_%s;\n PyInit_*;"%(modName), },
}, is_executable=False,
is_executable=False, )
) else:
else: ctx.actions.expand_template(
ctx.actions.expand_template( template=ctx.file.template_file,
template=ctx.file.template_file, output=ctx.outputs.versionscript,
output=ctx.outputs.versionscript, substitutions={
substitutions={ "*tensorflow*":"*tensorflow*\ninit_%s\nPyInit_*\n"%(mod_name),
"*tensorflow*":"*tensorflow*\ninit_%s\nPyInit_*\n"%(modName), },
}, is_executable=False,
is_executable=False, )
)
_append_init_to_versionscript= rule( _append_init_to_versionscript= rule(
implementation=_append_init_to_versionscript_impl, implementation=_append_init_to_versionscript_impl,
attrs={ attrs={
"module_name":attr.string(mandatory=True), "module_name":attr.string(mandatory=True),
"template_file":attr.label(allow_files=True,single_file=True,mandatory=True), "template_file":attr.label(allow_files=True,single_file=True,mandatory=True),
"is_version_script":attr.bool(default=True,doc='whether target is a ld version script or exported symbol list',mandatory=False), "is_version_script":attr.bool(default=True,
}, doc='whether target is a ld version script or exported symbol list',
outputs={"versionscript":"%{name}.lds"}, mandatory=False),
},
outputs={"versionscript":"%{name}.lds"},
) )
def tf_py_wrap_cc(name, def tf_py_wrap_cc(name,

View File

@ -358,8 +358,8 @@ def find_cuda_define(repository_ctx, header_dir, header_file, define):
if not h_path.exists: if not h_path.exists:
auto_configure_fail("Cannot find %s at %s" % (header_file, str(h_path))) auto_configure_fail("Cannot find %s at %s" % (header_file, str(h_path)))
result = repository_ctx.execute( result = repository_ctx.execute(
# Grep one more lines as some #defines are splitted into two lines. # Grep one more lines as some #defines are splitted into two lines.
["grep", "--color=never", "-A1", "-E", define, str(h_path)]) ["grep", "--color=never", "-A1", "-E", define, str(h_path)])
if result.stderr: if result.stderr:
auto_configure_fail("Error reading %s: %s" % (str(h_path), result.stderr)) auto_configure_fail("Error reading %s: %s" % (str(h_path), result.stderr))
@ -368,14 +368,14 @@ def find_cuda_define(repository_ctx, header_dir, header_file, define):
auto_configure_fail("Cannot find line containing '%s' in %s" % auto_configure_fail("Cannot find line containing '%s' in %s" %
(define, h_path)) (define, h_path))
#split results to lines #split results to lines
lines=result.stdout.split('\n') lines = result.stdout.split('\n')
lenLines=len(lines) lenLines = len(lines)
for l in range(lenLines): for l in range(lenLines):
line=lines[l] line = lines[l]
if define in line: # find the line with define if define in line: # find the line with define
version=line version = line
if l != lenLines-1 and line[-1] == '\\': # add next line, if multiline if l != lenLines-1 and line[-1] == '\\': # add next line, if multiline
version=version[:-1]+lines[l+1] version = version[:-1] + lines[l+1]
break break
#remove any comments #remove any comments
version = version.split("//")[0] version = version.split("//")[0]

View File

@ -5,8 +5,6 @@ licenses(["notice"])
exports_files(["LICENSE"]) exports_files(["LICENSE"])
load("@local_config_cuda//cuda:build_defs.bzl", "cuda_default_copts", "if_cuda")
package(default_visibility = ["//visibility:public"]) package(default_visibility = ["//visibility:public"])
cc_library( cc_library(