1load("//tensorflow/lite:build_def.bzl", "tflite_copts") 2 3package( 4 default_visibility = [ 5 "//visibility:public", 6 ], 7 licenses = ["notice"], 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_main", 74 "@flatbuffers", 75 ], 76) 77