Hi,
This is the right way to do it. We call such Tensors buffers.
It won’t have any impact on the computational graph as it does not require gradients.
It should be moved along with the parameters when you do model.to('cuda') though in your first code sample.