def METHOD_NAME(output_dir, config, num_layers, dump, val_loader=None, cuda=False):
    from tools.debug.common import load_torch_model
    from tools.debug.common import register_print_hooks
    if not os.path.exists(output_dir):
        os.makedirs(output_dir)
    model = load_torch_model(config, cuda)
    model_e = model.eval()
    if dump:
        register_print_hooks(output_dir, model_e, num_layers=num_layers, data_to_compare=None, dump_activations=True)
    validate_general(val_loader, model_e, infer_pytorch_model, cuda)