Hi,
No you should not modify the torch library. You can just make your change in your own python code. You never have to modify any torch code 
This tutorial shows you how to re-implement the same Module as the torch.nn.Linear Module but in your own code. This should be inside your own python project.