28
28
#include " k2/csrc/nbest.h"
29
29
#include " k2/csrc/nvtx.h"
30
30
#include " k2/csrc/tensor_ops.h"
31
- #include " k2/torch/csrc/ragged_any.h"
32
- #include " k2/torch/csrc/torch_utils.h"
33
- #include " k2/torch/python/csrc/doc/nbest.h"
34
- #include " k2/torch/python/csrc/nbest.h"
31
+ #include " k2/python/csrc/torch/nbest.h"
32
+ #include " k2/python/csrc/torch/torch_util.h"
33
+ #include " k2/python/csrc/torch/v2/ragged_any.h"
35
34
36
35
namespace k2 {
37
36
@@ -48,16 +47,18 @@ static void PybindGetBestMatchingStats(py::module &m) {
48
47
Array1<int32_t > counts_array = FromTorch<int32_t >(counts);
49
48
Array1<float > mean, var;
50
49
Array1<int32_t > counts_out, ngram_order;
51
- GetBestMatchingStats (tokens, scores_array, counts_array, eos, min_token,
52
- max_token, max_order, &mean, &var, &counts_out ,
53
- &ngram_order);
54
- return std::make_tuple (ToTorch (mean), ToTorch (var), ToTorch (counts_out),
55
- ToTorch (ngram_order));
50
+ GetBestMatchingStats (tokens, scores_array, counts_array,
51
+ eos, min_token, max_token, max_order ,
52
+ &mean, &var, &counts_out, & ngram_order);
53
+ return std::make_tuple (ToTorch (mean), ToTorch (var),
54
+ ToTorch (counts_out), ToTorch ( ngram_order));
56
55
},
57
56
py::arg (" tokens" ), py::arg (" scores" ), py::arg (" counts" ), py::arg (" eos" ),
58
- py::arg (" min_token" ), py::arg (" max_token" ), py::arg (" max_order" ),
59
- kNbestGetBestMatchingStatsDoc );
57
+ py::arg (" min_token" ), py::arg (" max_token" ), py::arg (" max_order" ));
60
58
}
61
59
62
- void PybindNbest (py::module &m) { PybindGetBestMatchingStats (m); }
63
60
} // namespace k2
61
+
62
+ void PybindNbest (py::module &m) {
63
+ k2::PybindGetBestMatchingStats (m);
64
+ }
0 commit comments