CAddTable function definitions in the pytorch package

Hi All,

In the when self.output.add_(input[i]) is executed , I was wondering how to find the C++ functions where the add() operation is defined

Thanks in advance,


All the C++ / CUDA implementations are present in ATen, and can be found in
For your questions in particular, cadd can be seen in here for CUDA, and here for the CPU implementation.

But many operations are moving straight to ATen, which gives more flexibility and nicer interfaces, see for example advanced indexing in ATen

@fmassa thank you so much for the reply and the references. So if we do inputTensor1 + inputTensor2 , the above C++ / CUDA implementations are called ,am I correct? Also I did a simple experiment. To make sure the function is called , a print command was included in the function and I ran the below code
import torch
import torch.legacy.nn as nn
x = torch.Tensor(2,2)
y = torch.Tensor(2,2)
out = nn.CAddTable().forward([x,y]) ( I know this command is obsolete now in pytorch 0.4)
and it didn’t print anything. Hence I was wondering if there are any other implementations for add function
I will recheck if I have made any mistake.