-
Have you tried using numpy?
In any case, it is not surprising that pytorch would be slower than python with these for-loops, given the overhead coming from the pytorch/autograd/tensor infrastructure. You can see for example the performance comparison for filters in torchaudio.
Is your goal in using pytorch to have a differentiable
edit_distance? -
Note also that the filters mentioned above seem to perform best in pure C++ implementation, as we discussed offline. There is support for C++ extensions, e.g. here or pybind.
Please register or sign in to comment