Function signatures to implement new backend

The documentation on implementing new backends points to RegistrationDeclaration.h. I noticed that existing implementations register functions with slightly different signatures. For instance:

  • Tensor view(const Tensor & self, c10::SymIntArrayRef size);
  • Is declared here for vukan the backend with inline Tensor view(const Tensor& self_arg, IntArrayRef shape)

Is this an oversight? Is the Dispatcher intelligent enough to distinguish implemented versions?

implemented version refers to the backend right - cpu/cuda etc? In that case, dispatcher can distinguish across the implementations. It maintains a dispatch table and dispatches the operation to the corresponding backend.

This Let’s talk about the PyTorch dispatcher : ezyang’s blog has details on how dispatcher works.

I read that blog post. It’s just that some implementations seem to assume more specialized types in the function arguments. AFAIK the dispatcher won’t know about that.