code: def accuracy(
      args, records, forecaster, train_loader, val_loader, test_loader
  ):
      """
      evaluate stage will record model accuracy.
      """
  
      if args.framework == "torch":
          forecaster.fit(
              train_loader,
              validation_data=val_loader,
              epochs=args.training_epochs,
              validation_mode="best_epoch",
          )
      else:
          forecaster.fit(train_loader, epochs=args.training_epochs)
  
      metrics = forecaster.evaluate(
          test_loader, multioutput="uniform_average"
      )
  
      for i in range(len(metrics)):
          records[args.metrics[i]] = metrics[i]
  
file_path: BigDL/python/chronos/src/bigdl/chronos/benchmark/benchmark_chronos.py
imports: from bigdl.chronos.benchmark import generate_forecaster, generate_data, get_CPU_info, check_nano_env
  import time
  import numpy
  import argparse
  import os
  from scipy import stats
  import psutil
  import subprocess
  from bigdl.nano.utils.common import invalidInputError
  from bigdl.nano.utils.common import spawn_new_process
label_desc: Use image node_id 4 for calling a global function with example usage: accuracy(args, records, forecaster, train_loader, val_loader, test_loader) without return types