Closed yuxuanzhang1995 closed 2 years ago
Hi @yuxuanzhang1995, it's hard to say without some more details and example code to reproduce, but assuming you are talking about the TNOptimizer
my guess is that you need to specify loss_constants
so that any extra tensors not included in the main tensor network can be converted to the right backend (tensorflow/jax/autograd happily accept numpy arrays as constant inputs, but torch does not...).
Exactly what I need. Thanks!
I got this:
TypeError: tensordot(): argument 'other' (position 2) must be Tensor, not numpy.ndarray
when I tried to use torch as autodiff_backend, which I believe is faster than tensorflow; I did not have this issue when I used tf before.