code: def evaluate_model(model):
      # By v3.0, the model will be instantiated by default.
      device = (
          torch.device("cuda")
          if torch.cuda.is_available()
          else torch.device("cpu")
      )
      model.to(device)
  
      optimizer = torch.optim.Adam(model.parameters(), lr=1e-3)
      transf = transforms.Compose(
          [
              transforms.ToTensor(),
              transforms.Normalize((0.1307,), (0.3081,)),
          ]
      )
      train_loader = DataLoader(
          MNIST("data/mnist", download=True, transform=transf),
          batch_size=64,
          shuffle=True,
      )
      test_loader = DataLoader(
          MNIST(
              "data/mnist", download=True, train=False, transform=transf
          ),
          batch_size=64,
      )
  
      for epoch in range(3):
          # train the model for one epoch
          train_epoch(model, device, train_loader, optimizer, epoch)
          # test the model for one epoch
          accuracy = test_epoch(model, device, test_loader)
          # call report intermediate result. Result can be float or dict
          nni.report_intermediate_result(accuracy)
  
      # report final test result
      nni.report_final_result(accuracy)
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  import nni
  from nni.nas.nn.pytorch import LayerChoice, ModelSpace, MutableDropout, MutableLinear
  import nni.nas.strategy
  import nni
  from torchvision import transforms
  from torchvision.datasets import MNIST
  from torch.utils.data import DataLoader
  from nni.nas.evaluator import FunctionalEvaluator
  from nni.nas.experiment import NasExperiment
  import os
  from pathlib import Path
label_desc: Use image node_id 3 for calling a global function with example usage: evaluate_model(model) without return types