You could pass through each individual block. Something like this
x1 = model.layer1(input)
x2 = model.layer2(x1)
x3 = model.layer3(x2)
x4 = model.layer4(x3)
etc. Then return the intermediate values.
You could pass through each individual block. Something like this
x1 = model.layer1(input)
x2 = model.layer2(x1)
x3 = model.layer3(x2)
x4 = model.layer4(x3)
etc. Then return the intermediate values.