I don’t know what “embedding” refers to in your use case, but if you want to store e.g. the penultimate activation of the model you could either return this activation directly in the forward method or you could use forward hooks.
Iterating the DataLoader would be the standard approach and you could store the outputs in e.g. a list and create the tensor afterwards.