I do agree lewtun’s comment. The outputs of training_step function can only be accessed in compute_loss function. Inside compute_loss, loss = outputs[0] but other indices in outputs are not used. Sometimes we wish to have other metrics (e.g., training acc) including loss as the outputs and print those metrics on tensorboard. But this version can not access the outputs during training.