I am reading the docs , and i am confusing about how the hook works.Here are some question in my mind

Does pytorch maintain the Variable’s consumer in Variable object?
At backward stage, the gradient of intermidiate Varaible is accumulated from different consumer and saved in variable.grad, and after backward, all the varaiable.grad of intermidiate Variable are reset to None ?
the two types of hook are all registered at Function object, at backward stage , the calling order is
hook registered by variable -> function.backward(..) -> hook registered by module->update varaible's grad ?

Anyone who can help me to sort it out, Thanks!