Do you average with gradient tensor?

When you normalize and out or average it, do you average it on it is sum with gradient or just taking it without its gradient?

avg = x/x.sum()
or
avg = x/x.sum().data