From 63db53490ed6eb65474ac17bc3d5e4222df6674b Mon Sep 17 00:00:00 2001 From: Alexis Asseman <33075224+aasseman@users.noreply.github.com> Date: Tue, 30 Apr 2019 15:25:01 -0700 Subject: [PATCH] Remove truncation in reversed SentenceIndexer --- ptp/components/text/sentence_indexer.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/ptp/components/text/sentence_indexer.py b/ptp/components/text/sentence_indexer.py index 2132b63..b13c83b 100644 --- a/ptp/components/text/sentence_indexer.py +++ b/ptp/components/text/sentence_indexer.py @@ -190,11 +190,6 @@ def tensor_indices_to_sentences(self, data_dict): # Add index to outputs. output_sample.append( output_word ) - # Apply fixed padding to all sequences if requested - # Otherwise let torch.nn.utils.rnn.pad_sequence handle it and choose a dynamic padding - if self.fixed_padding > 0: - pad_trunc_list(output_sample, self.fixed_padding) - # Add sentence to batch. outputs_list.append(output_sample) @@ -228,11 +223,6 @@ def tensor_distributions_to_sentences(self, data_dict): # Add index to outputs. output_sample.append( output_word ) - # Apply fixed padding to all sequences if requested - # Otherwise let torch.nn.utils.rnn.pad_sequence handle it and choose a dynamic padding - if self.fixed_padding > 0: - pad_trunc_list(output_sample, self.fixed_padding) - # Add sentence to batch. outputs_list.append(output_sample)