code: def compute_weight_diff(global_weights, local_var_dict):
      if global_weights is None:
          raise ValueError(
              "Cannot compute weight differences if `global_weights` is None!"
          )
      if local_var_dict is None:
          raise ValueError(
              "Cannot compute weight differences if `local_var_dict` is None!"
          )
      # compute delta model, global model has the primary key set
      weight_diff = {}
      n_diff = 0
      for name in global_weights:
          if name not in local_var_dict:
              continue
          # returned weight diff will be on the cpu
          weight_diff[name] = (
              local_var_dict[name].cpu() - global_weights[name].cpu()
          )
          n_diff += 1
          if torch.any(torch.isnan(weight_diff[name])):
              raise ValueError(f"Weights for {name} became NaN...")
      if n_diff == 0:
          raise RuntimeError("No weight differences computed!")
      return weight_diff
  
imports: from __future__ import annotations
  import os
  import time
  from collections.abc import Mapping, MutableMapping
  from typing import Any, cast
  import torch
  import torch.distributed
  from monai.apps.auto3dseg.data_analyzer import DataAnalyzer
  from monai.apps.utils import get_logger
  from monai.auto3dseg import SegSummarizer
  from monai.bundle import BundleWorkflow, ConfigComponent, ConfigItem, ConfigParser, ConfigWorkflow
  from monai.engines import SupervisedEvaluator, SupervisedTrainer, Trainer
  from monai.fl.client import ClientAlgo, ClientAlgoStats
  from monai.fl.utils.constants import ExtraItems, FiltersType, FlPhase, FlStatistics, ModelType, WeightType
  from monai.fl.utils.exchange_object import ExchangeObject
  from monai.networks.utils import copy_model_state, get_state_dict
  from monai.utils import min_version, require_pkg
  from monai.utils.enums import DataStatsKeys
label_desc: Use image node_id 2 for calling a global function with example usage: compute_weight_diff(global_weights, local_var_dict) and returns: weight_diff