I’m not aware of an easy shortcut, but the conversion is a composition of differentiable operations, so you can just implement the forward computation and backprop through it.
You can copy my implementation in go-colorful 207 which includes this conversion here 281, it does the conversion by passing through XYZ space, follow the code for equations.
The only non-trivial part in the chain is a couple data-dependent switches, you could either use this trick 281 or masked_scatter_ 31 for that, or you might get away with just ignoring them because they apply in the very low-luminosity range only.