# How does keras train_on_batch return value work?

From the doc, train_on_batch() will return a scalar representing the loss and the metric. I want to know whether the loss/metric is evaluated before the weight is updated or after the weight is updated?

I'm guessing that the loss/metric should be evaluated before the weight is updated because after the weight is updated you need to predict again which would cost compute time. I just want to reassure if I'm understanding it right.