Skip to content

Commit

Permalink
Doc: Update FAQs for sounddevice (#567)
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj authored Apr 8, 2024
1 parent 4eac91c commit 100a6e8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions sherpa/csrc/online-lstm-transducer-model.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ OnlineLstmTransducerModel::OnlineLstmTransducerModel(
joiner_ = torch::jit::load(joiner_filename, device);
joiner_.eval();

auto conv = decoder_.attr("conv").toModule();

context_size_ =
decoder_.hasattr("conv")
? decoder_.attr("conv").toModule().attr("weight").toTensor().size(2)
: 1;
conv.hasattr("weight") ? conv.attr("weight").toTensor().size(2) : 1;

// Use 5 here since the subsampling is ((len - 3) // 2 - 1) // 2.
int32_t pad_length = 5;
Expand Down
12 changes: 6 additions & 6 deletions sherpa/csrc/online-zipformer-transducer-model.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ OnlineZipformerTransducerModel::OnlineZipformerTransducerModel(
joiner_ = torch::jit::load(joiner_filename, device);
joiner_.eval();

auto conv = decoder_.attr("conv").toModule();

context_size_ =
decoder_.hasattr("conv")
? decoder_.attr("conv").toModule().attr("weight").toTensor().size(2)
: 1;
conv.hasattr("weight") ? conv.attr("weight").toTensor().size(2) : 1;

// Use 7 here since the subsampling is ((len - 7) // 2 + 1) // 2.
int32_t pad_length = 7;
Expand All @@ -49,10 +49,10 @@ OnlineZipformerTransducerModel::OnlineZipformerTransducerModel(
decoder_ = model_.attr("decoder").toModule();
joiner_ = model_.attr("joiner").toModule();

auto conv = decoder_.attr("conv").toModule();

context_size_ =
decoder_.hasattr("conv")
? decoder_.attr("conv").toModule().attr("weight").toTensor().size(2)
: 1;
conv.hasattr("weight") ? conv.attr("weight").toTensor().size(2) : 1;

// Use 7 here since the subsampling is ((len - 7) // 2 + 1) // 2.
int32_t pad_length = 7;
Expand Down
6 changes: 3 additions & 3 deletions sherpa/csrc/online-zipformer2-transducer-model.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ OnlineZipformer2TransducerModel::OnlineZipformer2TransducerModel(
decoder_ = model_.attr("decoder").toModule();
joiner_ = model_.attr("joiner").toModule();

auto conv = decoder_.attr("conv").toModule();

context_size_ =
decoder_.hasattr("conv")
? decoder_.attr("conv").toModule().attr("weight").toTensor().size(2)
: 1;
conv.hasattr("weight") ? conv.attr("weight").toTensor().size(2) : 1;

int32_t pad_length = encoder_.attr("pad_length").toInt();

Expand Down

0 comments on commit 100a6e8

Please sign in to comment.