The _out version for assignment/copy operation (tensor to std::vector related)?

OK actually I figured it out. The function is copy_.

torch::Tensor result = foo(); // a complicated computation function, parameters omitted
std::vector<double> v(100);
torch::Tensor result_copy = from_blob(v.data(), {100}, torch::kDouble);
result_copy.copy_(result); // this does the "in-place" copy I want

I was looking at the posts 70065 and 49600 for this topic earlier, which is why I asked for the _out version, but it took me a while to figure out the format (a little different from add_out function). Thanks tom there and in general I got many answers or relevant info from him.

I think the post should still contain some info others might be interested so I’d keep this thread around.