Skip to content

Commit

Permalink
Merge branch 'lgrigoryan/rm-redundant-calculations' of https://github…
Browse files Browse the repository at this point in the history
….com/lilithgrigoryan/NeMo into lgrigoryan/rm-redundant-calculations
  • Loading branch information
lilithgrigoryan committed Oct 11, 2024
2 parents 0917ceb + f3a10c4 commit 141ca40
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nemo/collections/asr/modules/rnnt.py
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,11 @@ def batch_concat_states(self, batch_states: List[List[torch.Tensor]]) -> List[to
for state_id in range(len(batch_states[0])):
batch_list = []
for sample_id in range(len(batch_states)):
tensor = torch.stack(batch_states[sample_id][state_id]) if not isinstance(batch_states[sample_id][state_id], torch.Tensor) else batch_states[sample_id][state_id] # [L, H]
tensor = (
torch.stack(batch_states[sample_id][state_id])
if not isinstance(batch_states[sample_id][state_id], torch.Tensor)
else batch_states[sample_id][state_id]
) # [L, H]
tensor = tensor.unsqueeze(0) # [1, L, H]
batch_list.append(tensor)

Expand Down

0 comments on commit 141ca40

Please sign in to comment.