forked from DeepRec-AI/DeepRec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_defs.bzl
37 lines (34 loc) · 1.3 KB
/
build_defs.bzl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# -*- Python -*-
load("//tensorflow:tensorflow.bzl", "tf_gen_op_wrapper_py")
# Intended only for use within this directory.
# Generated python wrappers are "private" visibility, users should depend on the
# full python code that incorporates the wrappers. The generated targets have
# a _gen suffix, so that the full python version can use the bare name.
# We also hard code the hidden_file here to reduce duplication.
#
# We should consider moving the "out" default pattern into here, many other
# consumers of the tf_gen_op_wrapper_py rule would be simplified if we don't
# hard code the ops/ directory.
def tf_gen_op_wrapper_private_py(
name,
out = None,
deps = [],
require_shape_functions = True,
visibility = []):
if not name.endswith("_gen"):
fail("name must end in _gen")
if not visibility:
visibility = ["//visibility:private"]
bare_op_name = name[:-4] # Strip off the _gen
tf_gen_op_wrapper_py(
name = bare_op_name,
out = out,
visibility = visibility,
deps = deps,
require_shape_functions = require_shape_functions,
generated_target_name = name,
api_def_srcs = [
"//tensorflow/core/api_def:base_api_def",
"//tensorflow/core/api_def:python_api_def",
],
)