code: def save_results(
      layer: LayerType,
      batch_size: int,
      num_runs: int,
      num_repeats: int,
      gsm_mode: Optional[str],
      results: List[Dict[str, Any]],
      config: Dict[str, Any],
      random_seed: Optional[int] = None,
      forward_only: bool = False,
      root: str = "./results/raw/",
      suffix: str = "",
  ) -> None:
      """Saves the corresponding results as a pickle file.
  
      Args:
          layer: full layer name
          batch_size: batch size
          num_runs: number of runs per benchmark
          num_repeats: how many benchmarks were run
          runtimes: list of runtimes of length num_repeats
          memory: list of memory stats of length num_repeats
          config: layer config
          random_seed: the initial random seed
          forward_only: whether backward passes were skipped
          root: directory to write results to
          suffix: optional string to append to file name
      """
      path = get_path(
          layer=layer,
          batch_size=batch_size,
          num_runs=num_runs,
          num_repeats=num_repeats,
          random_seed=random_seed,
          forward_only=forward_only,
          gsm_mode=gsm_mode,
          root=root,
          suffix=suffix,
      )
  
      with open(path, "wb") as handle:
          pickle.dump(
              {
                  "layer": layer,
                  "batch_size": batch_size,
                  "num_runs": num_runs,
                  "num_repeats": num_repeats,
                  "random_seed": random_seed,
                  "forward_only": forward_only,
                  "gsm_mode": gsm_mode,
                  "results": results,
                  "config": config,
              },
              handle,
              protocol=pickle.HIGHEST_PROTOCOL,
          )
  
file_path: opacus/benchmarks/utils.py
imports: import glob
  import pickle
  from collections import namedtuple
  from typing import Any, Dict, List, Optional
  import numpy
  import pandas
  import torch
  from benchmarks.layers import LayerType
label_desc: Use image node_id 4 for calling a global function with example usage: save_results(layer, batch_size, num_runs, num_repeats, gsm_mode, results, config, random_seed, forward_only, root, suffix) without return types