Pythonic implementation of F.linear

Hi, I try to learn the actual function by reading the code. For example, I want to understand what is happening in a linear layer (in forward and backward pass). I track from here to here and get lost.

My question is: Is it possible for me to find a pythonic (or jit or C) implementation, of the actual operation, e.g., x*w+b, in the pyTorch official repo? I am also looking for that of a Conv2d layer.

1 Like

This post shows where the underling methods for a linear layer are defined. Convolutions dispatch to different implementations from here (i.e. the CPU kernel, native CUDA kernel, cuDNN, etc.).

2 Likes