I have a big giant tensor shared between two processes/streams.
I want to create a simple lock,
it should combine both with (forward(), backward(), step()).
For forward and step I have a simple solution: overriding the toch.nn.Parameter class.
The problem is in backward/autograd.
We have a post-backward hook but no pre-backward hook.
Is there any possibility doing what I want in Pytorch?