Skip to content

Commit

Permalink
Format license and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Yibing Liu committed Mar 27, 2018
1 parent 18e0395 commit 193c7e2
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 15 deletions.
5 changes: 3 additions & 2 deletions fluid/DeepASR/decoder/post_decode_faster.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved.
/* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -69,7 +69,8 @@ Decoder::~Decoder() {
}

std::string Decoder::decode(
std::string key, std::vector<std::vector<kaldi::BaseFloat>>& log_probs) {
std::string key,
const std::vector<std::vector<kaldi::BaseFloat>>& log_probs) {
size_t num_frames = log_probs.size();
size_t dim_label = log_probs[0].size();

Expand Down
7 changes: 4 additions & 3 deletions fluid/DeepASR/decoder/post_decode_faster.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved.
/* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -37,8 +37,9 @@ class Decoder {
std::vector<std::string> decode(std::string posterior_rspecifier);

// Accept the scores of one utterance and return the decoding result
std::string decode(std::string key,
std::vector<std::vector<kaldi::BaseFloat>> &log_probs);
std::string decode(
std::string key,
const std::vector<std::vector<kaldi::BaseFloat>> &log_probs);

private:
// For decoding one utterance
Expand Down
19 changes: 10 additions & 9 deletions fluid/DeepASR/decoder/pybind.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved.
/* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -27,12 +27,13 @@ PYBIND11_MODULE(post_decode_faster, m) {
.def("decode",
(std::vector<std::string> (Decoder::*)(std::string)) &
Decoder::decode,
"Decode one input probability matrix "
"and return the transcription")
.def("decode",
(std::string (Decoder::*)(
std::string, std::vector<std::vector<kaldi::BaseFloat>>&)) &
Decoder::decode,
"Decode one input probability matrix "
"and return the transcription");
"Decode for the probability matrices in specifier "
"and return the transcriptions.")
.def(
"decode",
(std::string (Decoder::*)(
std::string, const std::vector<std::vector<kaldi::BaseFloat>>&)) &
Decoder::decode,
"Decode one input probability matrix "
"and return the transcription.");
}
2 changes: 1 addition & 1 deletion fluid/DeepASR/decoder/setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved.
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down

0 comments on commit 193c7e2

Please sign in to comment.