13
13
# limitations under the License.
14
14
# ==============================================================================
15
15
16
- load ("@tf//google/protobuf :protobuf.bzl" , "cc_proto_library" )
17
- load ("@tf//google/protobuf :protobuf.bzl" , "py_proto_library" )
16
+ load ("@protobuf// :protobuf.bzl" , "cc_proto_library" )
17
+ load ("@protobuf// :protobuf.bzl" , "py_proto_library" )
18
18
19
19
def if_cuda (if_true , if_false = []):
20
- """Shorthand for select()'ing on whether we're building with CUDA.
21
-
22
- Returns a select statement which evaluates to if_true if we're building
23
- with CUDA enabled. Otherwise, the select statement evaluates to if_false.
24
-
25
- """
20
+ """Shorthand for select()'ing on whether we're building with CUDA."""
26
21
return select ({
27
- "@tf //third_party/gpus/cuda:using_nvcc" : if_true ,
28
- "@tf //third_party/gpus/cuda:using_gcudacc" : if_true ,
22
+ "@org_tensorflow //third_party/gpus/cuda:using_nvcc" : if_true ,
23
+ "@org_tensorflow //third_party/gpus/cuda:using_gcudacc" : if_true ,
29
24
"//conditions:default" : if_false
30
25
})
31
26
32
27
def tf_copts ():
33
28
return (["-fno-exceptions" , "-DEIGEN_AVOID_STL_ARRAY" ,] +
34
29
if_cuda (["-DGOOGLE_CUDA=1" ]) +
35
- select ({"@tf //tensorflow:darwin" : [],
30
+ select ({"@org_tensorflow //tensorflow:darwin" : [],
36
31
"//conditions:default" : ["-pthread" ]}))
37
32
38
33
def tf_proto_library (name , srcs = [], has_services = False ,
@@ -47,9 +42,9 @@ def tf_proto_library(name, srcs=[], has_services=False,
47
42
cc_proto_library (name = name ,
48
43
srcs = srcs ,
49
44
deps = deps ,
50
- cc_libs = ["@tf//google/protobuf :protobuf" ],
51
- protoc = "@tf//google/protobuf :protoc" ,
52
- default_runtime = "@tf//google/protobuf :protobuf" ,
45
+ cc_libs = ["@protobuf// :protobuf" ],
46
+ protoc = "@protobuf// :protoc" ,
47
+ default_runtime = "@protobuf// :protobuf" ,
53
48
testonly = testonly ,
54
49
visibility = visibility ,)
55
50
@@ -58,8 +53,8 @@ def tf_proto_library_py(name, srcs=[], deps=[], visibility=None, testonly=0):
58
53
srcs = srcs ,
59
54
srcs_version = "PY2AND3" ,
60
55
deps = deps ,
61
- default_runtime = "@tf//google/protobuf :protobuf_python" ,
62
- protoc = "@tf//google/protobuf :protoc" ,
56
+ default_runtime = "@protobuf// :protobuf_python" ,
57
+ protoc = "@protobuf// :protoc" ,
63
58
visibility = visibility ,
64
59
testonly = testonly ,)
65
60
@@ -72,7 +67,7 @@ def tf_gen_op_libs(op_lib_names):
72
67
native .cc_library (name = n + "_op_lib" ,
73
68
copts = tf_copts (),
74
69
srcs = ["ops/" + n + ".cc" ],
75
- deps = (["@tf //tensorflow/core:framework" ]),
70
+ deps = (["@org_tensorflow //tensorflow/core:framework" ]),
76
71
visibility = ["//visibility:public" ],
77
72
alwayslink = 1 ,
78
73
linkstatic = 1 ,)
@@ -89,8 +84,8 @@ def tf_gen_op_wrapper_py(name, out=None, hidden=[], visibility=None, deps=[],
89
84
linkopts = ["-lm" ],
90
85
copts = tf_copts (),
91
86
linkstatic = 1 , # Faster to link this one-time-use binary dynamically
92
- deps = (["@tf //tensorflow/core:framework" ,
93
- "@tf //tensorflow/python:python_op_gen_main" ] + deps ),
87
+ deps = (["@org_tensorflow //tensorflow/core:framework" ,
88
+ "@org_tensorflow //tensorflow/python:python_op_gen_main" ] + deps ),
94
89
)
95
90
96
91
# Invoke the previous cc_binary to generate a python file.
@@ -110,5 +105,5 @@ def tf_gen_op_wrapper_py(name, out=None, hidden=[], visibility=None, deps=[],
110
105
srcs_version = "PY2AND3" ,
111
106
visibility = visibility ,
112
107
deps = [
113
- "@tf //tensorflow/python:framework_for_generated_wrappers" ,
108
+ "@org_tensorflow //tensorflow/python:framework_for_generated_wrappers" ,
114
109
],)
0 commit comments