Where do the 2000+ PyTorch operators come from?: More than you wanted to know

I actually noticed that I’d prefer scalars and tensors to be handled in separate functions, instead of one. For example I noticed at::add(Tensor,Tensor) was dispatched instead of at::add(Tensor,Scalar) while the second tensor was actually scalar and I need to handle it differently. Why is it important? Because naturally tensor exits on device’s storage (GPU memory) while scalar is always on CPU. So instead of giving dispatcher to handle it I need in my code to check if 2nd tensor is actually CPU scalar tensor and apply entirely different kernel to one that is scalar.

Also great summary and is very relevant for me (I work on OpenCL backend)

Can you share actual lists of operators you extracted (so I can understand the scope of work I need to do)