Hi,
x = torch.arange has a constant derivative/slope, however through the modulo, it becomes non defined at the modulo jump, which makes it non differentiable in each of these points. So as it is, indeed there is an issue for gradients I guess.
I alternatively tried to generate sawtooth as wavetables, by using interpolate to rescale a given sawtooth at a reference frequency to any other frequency, feeding the ratio of the wavetable reference frequency and the predicted f0.
However, it seems as well that interpolate does not accept a gradient variable in the scale factor. Is it correct ?
In this case it seems as well that backpropagation is not possible through the interpolate scale factor.