Closed isurulucky closed 1 month ago
This was due to a mistake from my end, where I had used Categorical distributions for the input nodes. I hacked around to use Gaussian distributions for input nodes, and did not get this issue thereafter. In the image_data
template method, its not possible to use Gaussians as inputs atm. Will open a separate issue to discuss the possibility of allowing Gaussians to be used in image_data
method.
Hi,
I was trying to use
torch.autograd.grad
to obtain the gradients of the log likelihoods w.r.t. to the input data in thelearning-a-circuit
notebook, right after the forward pass in the training loop:This gives me the
RuntimeError: One of the differentiated Tensors appears to not have been used in the graph. Set allow_unused=True if this is the desired behavior
error, which indicate the actual input to the compiled torch module could be a different tensor from what we use in the forward pass at:Can this be due to how the cirkit backend works with pytorch? Is there a way to work around this?
Thank you.