I want to do something similar to Pytorch/XLA backend. I modified Pytorch source to recognize a new backend and device type and in my custom c++ extension I registered the op by:
static auto registerer = torch::RegisterOperators()
   .op(torch::RegisterOperators::options().schema("aten::selu(Tensor self) -> Tensor")
       .impl_unboxedOnlyKernel<at::Tensor(const at::Tensor &), &MyRegisteredOps::selu>(at::DispatchKey::NewDispatchKey)

I am not creating new ops, just specifying a different backend for current ops but I don’t see any non-leaf nodes being dispatched such as the selu example above.