Fix 1-element in norm bug

This commit is contained in:
D-X-Y
2021-05-12 19:09:17 +08:00
parent 80ccc49d92
commit 06f4a1f1cf
3 changed files with 15 additions and 8 deletions

View File

@@ -66,6 +66,15 @@ class SuperModule(abc.ABC, nn.Module):
container.append(name, buf, False)
return container
def analyze_weights(self):
with torch.no_grad():
for name, param in self.named_parameters():
shapestr = "[{:10s}] shape={:}".format(name, list(param.shape))
finalstr = shapestr + "{:.2f} +- {:.2f}".format(
param.mean(), param.std()
)
print(finalstr)
@property
def abstract_search_space(self):
raise NotImplementedError