Hi @almeetb, in pytorch dispatcher compound=True means we have a mathematical definition of selu that works for all backends and we just by default use that implementation. So even you register a kernel to selu it won’t get called, instead it’ll be called at eluwhich is a non-compound op.
In general this works fine for most XLA ops (and it saves a lot of time as compound ops are supported “automatically”). But if you really really want to override a compound kernel, take a look at https://github.com/pytorch/xla/blob/master/torch_xla/csrc/aten_autograd_ops.cpp#L18 3. You’ll need to override both forward and backward through torch::autograd::Function, and register that kernel to a XLAPreAutograd key.