Error in logging of Regression Metrics
🐛 Bug
When attempting to log a regression metric object as described here when training for more than one epoch, the following error occurs,
RuntimeError: Only Tensors created explicitly by the user (graph leaves) support the deepcopy protocol at the moment

Interestingly, this error only occurs when using regression metrics. For example, Accuracy() works without any problems.
Boring Model Link
Link
Expected behavior
Logging should work for all metrics.
When comparing to metrics that work it seems that in the case of the regression metrics some of the variables (e.g. sum_squared_error) are still attached to the computational graph - which seems to be the cause of the problem. If I add the line,
preds = preds.detach()

to the update() method everything seems to work.
Environment
see colab.