hema_rathore:

Actually, I want to store these output layer activations for all the samples in my dataset (2000).


You could iterate the dataset and append all outputs in e.g. a list to store them. Make sure to call detach() on the output tensor to avoid storing the entire computation graph in this list, which would otherwise increase the memory usage.