File size: 196 Bytes
32c431e
 
 
 
 
 
 
1
2
3
4
5
6
7
import torch

@torch.no_grad()
def evaluate(model, val_loader):
    model.eval()
    outputs = [model.validation_step(batch) for batch in val_loader]
    return model.validation_epoch_end(outputs)