Can you change actual pytorch files and modify them

im trying to perform a task but because one of the files that runs a function im using does not allow for what i want to be done i was wondering can I delete the line in the file thats casuing the problem within the actual file, and then save it? will this fix the problem or no

What do you want to achieve? And what file and which line are stopping you?

it is line 43 of the AffineGridGenerator.cpp, it has a condition that makes sure that the third component of the theta variable is equal to 3 where i want to create a theta which only has its third component equal to 2 since im only capturing simple translations and thus dont need the full affine transformation.

If you change a .cpp file you are going to need to compile pytorch from source, and you would have to redo the modification each time you upgrade.

There ought to be a better way.