@ptrblck, problem solved. batch_size=4 , so l need to forward 4 exemples.
I have a question for you if you don’t mind  :
now l want to extract features from layer fc1. However, when l apply :
net.fc1.register_forward_hook(get_activation('fc1'))
l get always the output of fc2.
net
ConvNet_LeNet5(
(cl1): Linear(in_features=25, out_features=32, bias=True)
(cl2): Linear(in_features=25, out_features=64, bias=True)
(fc1): Linear(in_features=51200, out_features=100, bias=True)
(fc2): Linear(in_features=100, out_features=40, bias=True)
)

when l apply
net.fc1.register_forward_hook(get_activation('fc1'))
l’m supposed to vector of 100 features however l get 40.
Does you hook function
activation = {}
def get_activation(name):
    def hook(model, input, output):
        activation[name] = output.detach()
    return hook

works only for the last layer fc2 ?
Thank you