Home | History | Annotate | Download | only in tools
      1 package(default_visibility = [
      2     "//visibility:public",
      3 ])
      4 
      5 licenses(["notice"])  # Apache 2.0
      6 
      7 load("//tensorflow:tensorflow.bzl", "tf_cc_binary")
      8 
      9 py_binary(
     10     name = "visualize",
     11     srcs = ["visualize.py"],
     12     data = [
     13         "//tensorflow/contrib/lite/schema:schema.fbs",
     14         "@flatbuffers//:flatc",
     15     ],
     16     srcs_version = "PY2AND3",
     17 )
     18 
     19 tf_cc_binary(
     20     name = "generate_op_registrations",
     21     srcs = ["gen_op_registration_main.cc"],
     22     deps = [
     23         "//tensorflow/contrib/lite/tools:gen_op_registration",
     24         "//tensorflow/core:framework_internal",
     25         "//tensorflow/core:lib",
     26         "@com_google_absl//absl/strings",
     27     ],
     28 )
     29 
     30 tf_cc_binary(
     31     name = "benchmark_model",
     32     srcs = ["benchmark_model.cc"],
     33     linkopts = select({
     34         "//tensorflow:android": [
     35             "-pie",
     36             "-landroid",
     37             "-lm",
     38             "-z defs",
     39             "-Wl,--exclude-libs,ALL",  # Exclude syms in all libs from auto export
     40         ],
     41         "//conditions:default": [],
     42     }),
     43     deps = [
     44         ":mutable_op_resolver",
     45         "//tensorflow/contrib/lite:framework",
     46         "//tensorflow/contrib/lite:string_util",
     47         "//tensorflow/contrib/lite/kernels:builtin_ops",
     48     ],
     49 )
     50 
     51 cc_library(
     52     name = "gen_op_registration",
     53     srcs = ["gen_op_registration.cc"],
     54     hdrs = ["gen_op_registration.h"],
     55     deps = [
     56         "//tensorflow/contrib/lite:framework",
     57         "//tensorflow/contrib/lite:string",
     58         "@com_googlesource_code_re2//:re2",
     59     ],
     60 )
     61 
     62 cc_test(
     63     name = "gen_op_registration_test",
     64     srcs = ["gen_op_registration_test.cc"],
     65     data = [
     66         "//tensorflow/contrib/lite:testdata/0_subgraphs.bin",
     67         "//tensorflow/contrib/lite:testdata/2_subgraphs.bin",
     68         "//tensorflow/contrib/lite:testdata/empty_model.bin",
     69         "//tensorflow/contrib/lite:testdata/test_model.bin",
     70         "//tensorflow/contrib/lite:testdata/test_model_broken.bin",
     71     ],
     72     deps = [
     73         ":gen_op_registration",
     74         "@com_google_googletest//:gtest",
     75     ],
     76 )
     77 
     78 cc_library(
     79     name = "mutable_op_resolver",
     80     srcs = ["mutable_op_resolver.cc"],
     81     hdrs = ["mutable_op_resolver.h"],
     82     deps = ["//tensorflow/contrib/lite:framework"],
     83 )
     84 
     85 filegroup(
     86     name = "all_files",
     87     srcs = glob(
     88         ["**/*"],
     89         exclude = [
     90             "**/METADATA",
     91             "**/OWNERS",
     92         ],
     93     ),
     94     visibility = ["//tensorflow:__subpackages__"],
     95 )
     96 
     97 cc_library(
     98     name = "verifier",
     99     srcs = ["verifier.cc"],
    100     hdrs = ["verifier.h"],
    101     deps = [
    102         "//tensorflow/contrib/lite:framework",
    103         "//tensorflow/contrib/lite:schema_fbs_version",
    104         "//tensorflow/contrib/lite:string_util",
    105         "//tensorflow/contrib/lite/schema:schema_fbs",
    106         "@com_google_absl//absl/base:core_headers",
    107     ],
    108 )
    109 
    110 cc_test(
    111     name = "verifier_test",
    112     size = "small",
    113     srcs = ["verifier_test.cc"],
    114     deps = [
    115         ":mutable_op_resolver",
    116         ":verifier",
    117         "//tensorflow/contrib/lite:framework",
    118         "//tensorflow/contrib/lite:schema_fbs_version",
    119         "//tensorflow/contrib/lite:string_util",
    120         "//tensorflow/contrib/lite/schema:schema_fbs",
    121         "//tensorflow/contrib/lite/testing:util",
    122         "//tensorflow/core:framework_lite",
    123         "@com_google_googletest//:gtest",
    124         "@flatbuffers",
    125     ],
    126 )
    127