You could normalize the data first and then shift and scale it to the desired range:
x = torch.empty(1000).uniform_(5, 12)

y = (x - 5) / (12 - 5) # normalize to [0, 1]
print(y.min(), y.max())
> tensor(0.0026) tensor(1.0000)

y = (y  * (0.07 - 0.02)) + 0.02 # scale to [0.02, 0.07]
print(y.min(), y.max())
> tensor(0.0201) tensor(0.0700)