Hey!
So the way to go is:


function.conv_transpose2d calls into torch.conv_transpose2d.

torch.conv_transpose2d is nowhere in python files Search · conv_transpose2d · GitHub 2 meaning that it comes from c++
All C++ functions are defined in a nice yaml file: pytorch/native_functions.yaml at master · pytorch/pytorch · GitHub

You can find conv_transpose2d there: pytorch/native_functions.yaml at 12d63cc2f59e31c6472742babb6122eb1a1d7140 · pytorch/pytorch · GitHub 1

Nothing special mentionned, meaning that it is implemented in the native/ folder there (look for " conv_transpose2d(" )
You can find the function there: pytorch/Convolution.cpp at d8730194e7a7c46bea66d43d75238bc4a4d80627 · pytorch/pytorch · GitHub 2

Calling back into at:: namespace means that it goes through the native_functions.yaml file again.
No special dispatch for this one either: pytorch/native_functions.yaml at d8730194e7a7c46bea66d43d75238bc4a4d80627 · pytorch/pytorch · GitHub so looking for " convolution(" now.
You have it here: pytorch/Convolution.cpp at d8730194e7a7c46bea66d43d75238bc4a4d80627 · pytorch/pytorch · GitHub

Which then calls into the core conv implementation here: pytorch/Convolution.cpp at d8730194e7a7c46bea66d43d75238bc4a4d80627 · pytorch/pytorch · GitHub 2 where we choose the backend depending on what is available and what the user wants.