Output of each layer

This is the code for my NN i want to know the outputs of each layer i heard about forward_hooks but dont know how to use,anyone help me

image
image

I don’t think you need hooks to see the output of each layer, you can just log it in the forward function,
For example you can just print it

x1 = self.fc_spinal_layer1(x[:, 0:Half_width])
print(x1, x1.shape)

Or maybe I am misunderstanding something?

Hope this can help you.

its not working neithers showing any error