Home | History | Annotate | Download | only in quantization
      1 # Description:
      2 #   Utilities for quantizing TensorFlow graphs to lower bit depths.
      3 
      4 package(default_visibility = ["//visibility:public"])
      5 
      6 licenses(["notice"])  # Apache 2.0
      7 
      8 exports_files(["LICENSE"])
      9 
     10 load("//tensorflow:tensorflow.bzl", "py_test")
     11 
     12 py_library(
     13     name = "quantize_graph_lib",
     14     srcs = ["quantize_graph.py"],
     15     srcs_version = "PY2AND3",
     16     deps = [
     17         "//tensorflow/core:protos_all_py",
     18         "//tensorflow/python:array_ops",
     19         "//tensorflow/python:constant_op",
     20         "//tensorflow/python:dtypes",
     21         "//tensorflow/python:framework",
     22         "//tensorflow/python:framework_ops",
     23         "//tensorflow/python:graph_util",
     24         "//tensorflow/python:platform",
     25         "//tensorflow/python:session",
     26         "//tensorflow/python:tensor_shape",
     27         "//tensorflow/python:tensor_util",
     28         "//third_party/py/numpy",
     29     ],
     30 )
     31 
     32 py_binary(
     33     name = "quantize_graph",
     34     srcs = ["quantize_graph.py"],
     35     srcs_version = "PY2AND3",
     36     deps = [
     37         "//tensorflow/core:protos_all_py",
     38         "//tensorflow/python",  # TODO(b/34059704): remove when fixed
     39         "//tensorflow/python:array_ops",
     40         "//tensorflow/python:client",
     41         "//tensorflow/python:framework",
     42         "//tensorflow/python:framework_for_generated_wrappers",
     43         "//tensorflow/python:graph_util",
     44         "//tensorflow/python:platform",
     45         "//tensorflow/python:tensor_util",
     46         "//third_party/py/numpy",
     47     ],
     48 )
     49 
     50 py_test(
     51     name = "quantize_graph_test",
     52     size = "small",
     53     srcs = ["quantize_graph_test.py"],
     54     srcs_version = "PY2AND3",
     55     tags = ["nomsan"],  # http://b/32242946
     56     deps = [
     57         ":quantize_graph",
     58         "//tensorflow/core:protos_all_py",
     59         "//tensorflow/python:client",
     60         "//tensorflow/python:client_testlib",
     61         "//tensorflow/python:framework",
     62         "//tensorflow/python:framework_for_generated_wrappers",
     63         "//tensorflow/python:graph_util",
     64         "//tensorflow/python:platform",
     65         "//third_party/py/numpy",
     66     ],
     67 )
     68 
     69 py_binary(
     70     name = "graph_to_dot",
     71     srcs = ["graph_to_dot.py"],
     72     main = "graph_to_dot.py",
     73     srcs_version = "PY2AND3",
     74     deps = [
     75         "//tensorflow/core:protos_all_py",
     76         "//tensorflow/python:platform",
     77     ],
     78 )
     79 
     80 filegroup(
     81     name = "all_files",
     82     srcs = glob(
     83         ["**/*"],
     84         exclude = [
     85             "**/METADATA",
     86             "**/OWNERS",
     87         ],
     88     ),
     89     visibility = ["//tensorflow:__subpackages__"],
     90 )
     91