After registering a forward hook, you would need to perform a forward pass, so that the input and output will be filled with tensors.
Also, if lastfc is your last layer, you’ll also get its output as the return value from your model’s forward:
output = model(data)