We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5d31732 commit 9c7b836Copy full SHA for 9c7b836
1 file changed
train_network.py
@@ -139,7 +139,7 @@ def analyze_gradient_norms(parameters):
139
140
@torch.no_grad()
141
def analyze_model_norms(unscaled_norms):
142
- if unscaled_norms is None or unscaled_norms.numel() == 0:
+ if unscaled_norms is None or not isinstance(unscaled_norms, torch.Tensor) or unscaled_norms.numel() == 0:
143
return {
144
'model/module_norm/unscaled/mean': 0.0,
145
'model/module_norm/unscaled/median': 0.0,
0 commit comments