Accessing activation values in the optimizer

Hi,

I am making a custom optimization function and I want to somehow get the activation vector coming into the node.

As far as I understand:
p.data is the current value of the parameter p
p.grad.data is the current value of the gradient for parameter p

How do I get the actual data coming into the parameter?

Thanks,
David