import torch


def val_loop(model, loss_fn, samples, labels, batch_size, seq_len, device='cpu', pre_trained=False):
    """
    Standard pytorch validation loop, using our helper loss function above
    :param model: model to test
    :param loss_fn: loss function to evaluate with
    :param samples: data in
    :param labels: labels out
    :param batch_size: batch size
    :param seq_len: sequence length
    :param device: device to put tensors on
    :param pre_trained: are we using pre-trained embeddings or indices?
    :return: loss and accuracy for evaluation
    """
    loss_total = 0
    acc_total = 0
    total_samples = 0
    with torch.no_grad():
        # Again, step through data taking batch_size*sequence_length sized steps
        # For each step, use your helper loss function to get a loss value and accuracy total
        # DO NOT STEP THE OPTIMIZER OR BACKPROP THE LOSS
        pass

    # Return loss and accuracy
    return loss_total, acc_total/total_samples