tl;tr: torch >=v1.2.0
Hey @dakshanand,
I just ran into the same issue. In case anybody else is wondering: Update torch to >=1.2.0. Before this version, hooks were read-only, now they can modify the output.
Best