Remove the need for including a loss function in the model
Closed this issue · 1 comments
We should be able to remove the need for a loss function by calling .sum()
on the final returned tensor without introducing any significant negative effects.
This is a potential improvement to the providers, which is related to issue #29.
Implemented in commit 472aedc. The loss function now does not need to be included inside the model. For it to be profiled, the user needs to include it in the model. However this is not a fundamental limitation (we decided to do this just for simplicity in dealing with identifying each operation's "module").
Note, now we determine when the iteration's forward pass is complete by looking for a call to .backward()
on an output tensor. Therefore we assume the user calls .backward()
on a tensor exactly once during an iteration. This assumption should be reasonable for typical PyTorch use cases. We will update the documentation to reflect these changes.