I am trying to find the function definition and implementation of torch.real in the source code, for example, this line. I thought it should be in the torch.__init__.py, but didnt find it. Any idea?
>Solution :
It’s a different __init__ file since it’s implemented in C++
- https://github.com/pytorch/pytorch/blob/main/torch/_C/__init__.pyi.in#L1472-L1482
- https://github.com/pytorch/pytorch/blob/main/torch/csrc/autograd/python_variable.cpp#L1453-L1464