code: def test(args, model, device, test_loader, epoch):
      model.eval()
      test_loss = 0
      correct = 0
      with torch.no_grad():
          for data, target in test_loader:
              data, target = data.to(device), target.to(device)
              output = model(data)
              test_loss += F.nll_loss(
                  output, target, reduction="sum"
              ).item()  # sum up batch loss
              pred = output.argmax(
                  dim=1, keepdim=True
              )  # get the index of the max log-probability
              correct += pred.eq(target.view_as(pred)).sum().item()
  
      test_loss /= len(test_loader.dataset)
  
      Logger.current_logger().report_scalar(
          "test", "loss", iteration=epoch, value=test_loss
      )
      Logger.current_logger().report_scalar(
          "test",
          "accuracy",
          iteration=epoch,
          value=(correct / len(test_loader.dataset)),
      )
      print(
          "Test set: Average loss: {:.4f}, Accuracy: {}/{} ({:.0f}%)".format(
              test_loss,
              correct,
              len(test_loader.dataset),
              100.0 * correct / len(test_loader.dataset),
          )
      )
  
file_path: clearml/examples/frameworks/pytorch/pytorch_abseil.py
imports: from __future__ import print_function
  import os
  from tempfile import gettempdir
  import torch
  import torch.nn
  import torch.nn.functional
  import torch.optim
  from absl import app, flags
  from torchvision import datasets, transforms
  from clearml import Task, Logger
label_desc: Use image node_id 2 for calling a global function with example usage: test(args, model, device, test_loader, epoch) without return types