It seems there’s no low pass filter in PyTorch.
If I want to write my own low pass filter function low_pass()
How do I make sure that it can apply to whole batch?
During training, the dataloader will give me a tensor X with the shape (batch, audio_len).
But my neural network design takes in 4 inputs

The origianl X

The lowpassed+downsampled version of X, let’s call it X_down1

lowpassed+downsampled X_down1 again to get X_down2

Same opeations again to get X_down3


For the downsample part, I can use the Average pooling 1D to get what I want, and it’s fast, since it applies to the whole batch.
And I think I need to write my own low_pass function. But how to make sure that this function also applies to the whole batch just like Average pooling?