How to create model with sharing weight?

in your example, what will happen to gradients of self.base? will they be calculated taking into account both input1 and input2?