mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-12-11 06:55:27 +00:00
from local
This commit is contained in:
parent
fac31c76e9
commit
23e9d7edf0
Binary file not shown.
@ -676,7 +676,15 @@ def compute_loss(
|
||||
feature = feature.to(device)
|
||||
|
||||
supervisions = batch["supervisions"]
|
||||
feature_lens = supervisions["num_frames"].to(device)
|
||||
if feature.ndim == 2:
|
||||
feature_lens = []
|
||||
for supervision in supervisions['cut']:
|
||||
try: feature_lens.append(supervision.tracks[0].cut.recording.num_samples)
|
||||
except: feature_lens.append(supervision.recording.num_samples)
|
||||
feature_lens = torch.tensor(feature_lens)
|
||||
|
||||
elif feature.ndim == 3:
|
||||
feature_lens = supervisions["num_frames"].to(device)
|
||||
|
||||
batch_idx_train = params.batch_idx_train
|
||||
warm_step = params.warm_step
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user