So I’ve heard that the happy people use torch::Tensor, not at::Tensor 29. (What also works, and this is needed when you do stuff in ATen itself, is to grab some input’s t.options() and use that in the factory functions.)
I’ll admit, that it’s a bit hard to find in the C++ docs 19 at the moment, but they’ll likely soon be awesome.
Also, you don’t want to use indexing this way with tensors. As these seem to be pointwise ops, use TensorAccessors (auto t_a = temp.accessor<float, 3>()).
Note that you need to do type dispatching for this, if you want it to work with various dtypes. You’ll find patterns for this in the ATen/native subdirectory of the source code (e.g. I implemented the CPU CTC loss using accessors 13).
Best regards
Thomas