Performance, Pytorch, Deep Learning, Artificial Intelligence, Tensorboard.
torch.nn.CrossEntropyLoss(ignore_index=-1) def forward(self, pred: Tensor, target: Tensor) -> Tensor: with torch.profiler.record_function('calc loss'): loss = self.loss(pred, target) return loss In the image below we show the resultant Trace View: Final Trace View (Captured by Author) Holy cow!!