thank you so much. but if in the second method.
out_resnet = resnet(input)
out_densenet = densenet(input)
out = out_resnet + out_densenet

if out_resnet = 0.7,  out_densenet  = 0.8
and out_resnet + out_densenet > 1
so do we need to change the code like that?:
out = (out_resnet + out_densenet) / 2

Is there a full blown example of how to ensemble two models for example- resnet18 and densenet19 for prediction on the same dataset? I would really appreciate it.