I want to use the function batch_pad_right() as a collate_fn with mode ‘circular’ in my dataloader. However, when I apply this function on a signal data in the dataloader, it shows error: NotImplementedError(“Only 3D, 4D, 5D padding with non-constant padding are supported for now”). And the hparam for dataloader is:
Actually, in function batch_pad_right(), the tensors in a batch are processed one-by-one, so the input of torch.pad is a 1-D tensor, leading to this NotImplementedError.
I do not know if I miss some points. I appreciate if there are any other solutions. Although the torch does not support pad on 1-D or 2-D tensor, I think this function should be more robust to deal with this problem. Like just reshaping the tensor to 3-D using torch.unsqueeze()?