Hmmm i don’t really know which files are u using but if u have a tensor or a np vector ur scaling is just new=scalar*old. That operation is optimized in both, np and pytorch.
If u have a python list you can conver it to a tensor using torch.stack (i guess) or np.asarray()