I define a discriminator as follow:
class D(nn.Module):
def init(self, ngpu):
super(D,self).init()
self.main = nn.Sequential(OrderedDict([
(‘conv1’, nn.Conv2d()),
(‘relu1’, nn.ReLU()),
‘conv2’, nn.Conv2d())
(‘out’, nn.Signoid())
]))
and I want to use modify one layer by
D.conv1.weight.data
but it doesn’t work because “D” object has not attribute “conv1”
thank you