[Caffe2] How can I get the output of each layer as ndarray?

I use workspace in caffe2.python to load my model. And I want to visualize the output of each layer. Is there any way? I use workspace in the way shown below:

init_net = ‘Path to init_net’
predict_net = ‘Path to predict_net’
p = workspace.Predictor(init_net, predict_net)