I’ve been trying many things without success, unfortunately. Basically, this is what I want:
X --> PyTorch model --> X* --> TF model
Then, I can obtain the gradient w.r.t X* through the TF model, but I want to propagate it through the PyTorch model to obtain an X.grad.
This is how far I’ve come:
I’m new to writing custom gradient functions, so my code probably doesn’t make much sense. Hope anyone can help out.