Hi,
rapeat makes new copies of the tensor each time. This is expected (depending on the behaviour you expect for your gradients)
You can alternatively use expand
https://pytorch.org/docs/stable/tensors.html?highlight=expand_as#torch.Tensor.expand 10
Please read the docs in order to be aware of the differences.
From docs:

More than one element of an expanded tensor may refer to a single memory location. As a result, in-place operations (especially ones that are vectorized) may result in incorrect behavior. If you need to write to the tensors, please clone them first.