I use the same evaluator for both train_loader and val_loader . Are the metrics calculated during training, or does the evaluator iterate the set again after the training epoch (with other random transforms) , just without updating the weights?

Evaluator does not compute metrics during the training. Yes, evaluator iterates the set again and metrics are computed with “fixed” model (without updating the weights).

On the train set, the metrics should take into account the samples of the whole epoch (512 samples)

in this case you need to just set epoch_length=512 in evaluator.run(train_loader, epoch_length=512).