Hi,
I want to know the answer from Torch perceptive. If my network looks like this:
a = nn.Sequential()
a:add(nn.Linear(10,20))
a:add(nn.Linear(10,20))
I would have done:
a:get(1).weight:set(a:get(2).weight) Similar for bias, gradWeight, and gradBias
In PyTorch:
self.fc1 = nn.Linear(10,20)
self.fc7 = nn.Linear(10,20)
What should I do?
self.fc7.weight = self.fc1.weight and similar for bias?
As I see there is no set command. And also linear object has no attribute for ‘gradWeight’!
Would that be enough to share gradWeights and gradBias?
Thanks.