so i couldn't achieve one thing in pytorch and after an hour of typical googling i decided to use chatgpt and achieved this thing in 5 minutes. Finally a competition to your shitty search engine results!