Skip to content

Commit

Permalink
fix(torch): handle case where sequence data is < wanted timestep
Browse files Browse the repository at this point in the history
  • Loading branch information
fantes authored and sileht committed Sep 14, 2020
1 parent 81f47c9 commit b6d394a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/backends/torch/torchinputconns.cc
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ namespace dd
at::Tensor lst = torch::stack(label_sequence);
dataset.add_batch({ dst }, { lst });
}
if (dv.rem != 0)
if (dv.rem != 0 && seq.size() >= _timesteps)
{
std::vector<at::Tensor> data_sequence;
std::vector<at::Tensor> label_sequence;
Expand Down

0 comments on commit b6d394a

Please sign in to comment.