Caffe2 - C++ API
A deep learning, cross platform ML framework
ctc_beam_search_decoder_op.h
1 #ifndef CAFFE2_OPERATORS_CTC_BEAM_SEARCH_OP_H_
2 #define CAFFE2_OPERATORS_CTC_BEAM_SEARCH_OP_H_
3 
4 #include "caffe2/core/context.h"
5 #include "caffe2/core/operator.h"
6 
7 namespace caffe2 {
8 
9 template <class Context>
10 class CTCBeamSearchDecoderOp : public Operator<Context> {
11  public:
12  USE_OPERATOR_CONTEXT_FUNCTIONS;
13  template <class... Args>
14  explicit CTCBeamSearchDecoderOp(Args&&... args)
15  : Operator<Context>(std::forward<Args>(args)...) {
16  beam_width_ = this->template GetSingleArgument<int32_t>("beam_width", 10);
17  prune_threshold_ =
18  this->template GetSingleArgument<float>("prune_threshold", 0.001);
19  }
20 
21  bool RunOnDevice() override;
22 
23  protected:
24  int32_t beam_width_;
25  float prune_threshold_;
26  INPUT_TAGS(INPUTS, SEQ_LEN);
27  OUTPUT_TAGS(OUTPUT_LEN, VALUES);
28  // Input: X, 3D tensor; L, 1D tensor. Output: Y sparse tensor
29 };
30 
31 } // namespace caffe2
32 
33 #endif // CAFFE2_OPERATORS_CTC_BEAM_SEARCH_OP_H_
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...
Definition: blob.h:13