Thanks, my problem solved.
I used ScipyConv2dFunction class on this page:
https://pytorch.org/tutorials/advanced/numpy_extensions_tutorial.html 16
I customized correlate2d and convovle2d by myself. After that, each run for each sample of data lasts about 15 seconds on CPU. For decreasing the time, I switched to GPU and I changed numpy to tensor. Unfortunately, the time increased to 3 mins.
Do you have any idea about how to improve the time?
Many thanks before all