I am new to pytorch, and I am reading a piece of code
import torch.nn.init as init
for m in self.modules():
if isinstance(m, nn.Conv2d):
init.orthogonal_(m.weight)
if m.bias is not None:
init.constant_(m.bias, 0)
elif isinstance(m, nn.BatchNorm2d):
init.constant_(m.weight, 1)
init.constant_(m.bias, 0)
I read the document of nn.module and do not find any detail about this weight attribute, so please help me to find out where does this attribute defined. How to know what attribute or method I have when I use a nn.module?