diff options
Diffstat (limited to 'third_party/ngraph/build_defs.bzl')
-rw-r--r-- | third_party/ngraph/build_defs.bzl | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/third_party/ngraph/build_defs.bzl b/third_party/ngraph/build_defs.bzl new file mode 100644 index 0000000000..2c9027a6b8 --- /dev/null +++ b/third_party/ngraph/build_defs.bzl @@ -0,0 +1,16 @@ +def clean_dep(dep): + return str(Label(dep)) + +def if_ngraph(a): + """Shorthand for select()'ing on whether we're building with nGraph support. + + Returns a select statement which evaluates to if_true if we're building + with nGraph. Otherwise, the select statement evaluates to default. + + """ + ret_val = select({ + clean_dep("//tensorflow:with_ngraph_support"): a, + "//conditions:default": [] + }) + + return ret_val |