Closed ji-xin closed 3 years ago
It's indeed possible. The second return from https://github.com/zhijian-liu/torchprofile/blob/master/torchprofile/utils/trace.py#L17 is actually the output of the inference. However, I'm not sure about the motivation behind this. It's always fairly easy to re-run the forward pass.
Thanks for the reply! It's purely for efficiency, just so I don't need to run the forward pass twice. By the way, do you know how fast a forward pass with profile_mac
is compared with a usual one?
As in
macs = profile_macs(model, inputs)
- is there a way to also obtain the model's output given inputs, without running the forward pass again?