def forward(self, x):
    if self.dowsample:
        identity = self.downsample(x)
    else:
        identity = x





    if need_downsampling == True:
        self.downsample = do the downsampling stuff
    else:
        self.downsample = lambda x : x

def forward(self, x):
    identity = self.downsample(x)

Is one of the above more computation or memory efficient than the other?