• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1load("//tensorflow/lite:build_def.bzl", "tflite_copts")
2
3package(
4    default_visibility = [
5        "//visibility:public",
6    ],
7    licenses = ["notice"],  # Apache 2.0
8)
9
10# ctc support classes imported directly from TensorFlow.
11cc_library(
12    name = "ctc_utils",
13    hdrs = [
14        "ctc_beam_entry.h",
15        "ctc_beam_scorer.h",
16        "ctc_beam_search.h",
17        "ctc_decoder.h",
18        "ctc_loss_util.h",
19    ],
20    deps = [
21        ":top_n",
22        "//tensorflow/lite/kernels/internal:compatibility",
23        "//third_party/eigen3",
24    ],
25)
26
27# top_n support classes imported directly from TensorFlow.
28cc_library(
29    name = "top_n",
30    hdrs = [
31        "top_n.h",
32    ],
33    deps = [
34        "//tensorflow/lite/kernels/internal:compatibility",
35    ],
36)
37
38cc_library(
39    name = "ctc_beam_search_decoder_op",
40    srcs = [
41        "ctc_beam_search_decoder.cc",
42    ],
43    # Suppress warnings that are introduced by Eigen Tensor.
44    copts = tflite_copts() + [
45        "-Wno-error=reorder",
46    ] + select({
47        "//tensorflow:ios": ["-Wno-error=invalid-partial-specialization"],
48        "//conditions:default": [
49        ],
50    }),
51    deps = [
52        ":ctc_utils",
53        "//tensorflow/lite:framework",
54        "//tensorflow/lite/c:common",
55        "//tensorflow/lite/kernels:kernel_util",
56        "//tensorflow/lite/kernels:op_macros",
57        "//tensorflow/lite/kernels/internal:optimized_base",
58        "//tensorflow/lite/kernels/internal:tensor",
59        "@flatbuffers",
60    ],
61)
62
63cc_test(
64    name = "ctc_beam_search_decoder_test",
65    size = "small",
66    srcs = ["ctc_beam_search_decoder_test.cc"],
67    tags = ["tflite_not_portable_ios"],
68    deps = [
69        ":ctc_beam_search_decoder_op",
70        "//tensorflow/lite:framework",
71        "//tensorflow/lite/kernels:builtin_ops",
72        "//tensorflow/lite/kernels:test_util",
73        "@com_google_googletest//:gtest",
74        "@flatbuffers",
75    ],
76)
77
78cc_library(
79    name = "gru_cell",
80    srcs = ["gru_cell.cc"],
81    hdrs = ["gru_cell.h"],
82    deps = [
83        "//tensorflow/lite/kernels:cpu_backend_context",
84        "//tensorflow/lite/kernels/internal:optimized_base",
85        "//tensorflow/lite/kernels/internal:tensor",
86        "//third_party/eigen3",
87    ],
88)
89
90cc_library(
91    name = "unidirectional_sequence_gru_op",
92    srcs = [
93        "unidirectional_sequence_gru.cc",
94    ],
95    # Suppress warnings that are introduced by Eigen Tensor.
96    copts = tflite_copts() + [
97        "-Wno-error=reorder",
98    ] + select({
99        "//tensorflow:ios": ["-Wno-error=invalid-partial-specialization"],
100        "//conditions:default": [
101        ],
102    }),
103    deps = [
104        ":gru_cell",
105        "//tensorflow/lite:framework",
106        "//tensorflow/lite/c:common",
107        "//tensorflow/lite/kernels:cpu_backend_context",
108        "//tensorflow/lite/kernels:kernel_util",
109        "//tensorflow/lite/kernels:op_macros",
110        "//tensorflow/lite/kernels/internal:tensor",
111        "@flatbuffers",
112    ],
113)
114
115cc_test(
116    name = "unidirectional_sequence_gru_test",
117    size = "small",
118    srcs = ["unidirectional_sequence_gru_test.cc"],
119    tags = ["tflite_not_portable_ios"],
120    deps = [
121        ":unidirectional_sequence_gru_op",
122        "//tensorflow/lite:framework",
123        "//tensorflow/lite/kernels:test_util",
124        "@com_google_googletest//:gtest",
125    ],
126)
127