I am trying to extract the outputs of  the intermediate layers  of an already pretrained_ network (in this case vgg ) as features , for some pictures as input to these networks.(there  is no training or evaluating involved in the process) . later on I will try to do some analysis  on these features. I just  need the float data of the each layers output  for a specific picture . So how can I get rid of the computational graph ? would tensor.item() do the trick ? I have tested this out  but it’s really slow !