Skip to content
Snippets Groups Projects
Commit d46c2624 authored by chinyun_yu_joey's avatar chinyun_yu_joey
Browse files

fix chunk size too small error

parent 4bf09366
No related branches found
Tags submission-fuser-19
No related merge requests found
......@@ -92,8 +92,13 @@ def separate(
with torch.no_grad():
mag = X.abs()
frames = 2584
min_frames = 516
masked_tf_rep = []
for chunk in tqdm(mag.split(frames, dim=-1)):
chunks = mag.split(frames, dim=-1)
if len(chunks) > 1 and chunks[-1].shape[-1] < min_frames:
chunks[-2:] = torch.cat(chunks[-2:], -1).chunk(2, -1)
for chunk in tqdm(chunks):
masked_tf_rep += [x_umx_target(chunk.unsqueeze(0)).squeeze()]
masked_tf_rep = torch.cat(masked_tf_rep, -1) * mag
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment