Hi Thomas and thanks for the reply, thats indeed what I have already tried, and it does not work for my system. I have now tried the latest binaries, so to me it rather looks like it was a bug.
The detach_() approach works !  So for this simple example it is
torch::Tensor desired_out = linear2->forward(in).detach();