Hello guys,
My cost function is very specific and needs a lot of external calculations, including using external libraries, to get the cost value. Because of this, it is impossible to keep such calculations under tensors. The problem with getting out of the tensor context is that I lose track of the autograd history. How could I take the scalar value produced by my cost function, encapsulate it in a tensor, and reconnect it to the autograd graph?