So I am trying to modify the tanh() and sigmoid() implementation and noticed there are files Tanh.cu and Sigmoid.cu inside aten/src/THCUNN folder. To debug the code, I added a printf in the .cu files and called the tanh function from python by import torch.nn and nothing was printed out. When I imported torch.legacy.nn and then called the tanh function, the program was going through the .cu files as the test print statement got printed.
Could anyone please explain why the program doesn’t go through .cu files when Tanh and Sigmoid are called from torch.nn ? Also in this case I wonder where the implementation of Tanh and Sigmoid (C++ / Cuda) would be?
Thanks in advance!