Noise gate from torchaudio functional or transforms


Is there a way to replicate a noise gate using either a functional or transforms filter in plain pytorch audio? As part of my pipeline I’ve been able to keep everything on the GPU except for a noise gate, where I move the tensor back to CPU and get it’s numpy handle to run it through Pedalboard’s noise gate. If I used a torch sox effect it would still be on the CPU. If anyone has worked on their own solution, I’d be glad to see.