Using Pytorch neural network as the custom “black box” likelihood function

You wrapped your NN in an Op, so it seems totally consistent with what I suggested in the post you linked. Am I missing something?