The code generally looks good, and we’d want to merge Lop, Rop and Hv. The first two utilities don’t seem to fit autograd very well, and I can’t find any resources about the fisher product (it also looks a bit hacky due to the conditional on the loss function). You’d need to stop detaching too, since that application specific.