Hi,
First, you should never use .data as it mostly leads to issues.
Second, you call .detach() on the data_batch before passing it to the normalize function. So you explicitly break the graph. This is why you don’t get any gradients back.