
Could someone explain how this works? namely, why does it create a new tensor and register hooks on the new tensor’s grad_fn.next_functions[0][0] (what is this function)?
What’s the difference between this and directly register hooks on the original tensor register_hook

Thanks.