Hi @SupremePROC
The root node x returned by the function point to the recorded backward graph, which has my_w and my_b as leaf nodes. They are recorded in x's graph, independently of their scope (global or local).
So their grad will get updated (as they are leaf nodes).
Find more details about autograd 1 here.