code: def update_temp(model, grad, lr):
      model_copy = copy.deepcopy(model)
      for g, p in zip(grad, model_copy.parameters()):
          if g is not None:
              p.data = p.data - lr * g
      return model_copy
  
file_path: avalanche/avalanche/training/plugins/mir.py
imports: import copy
  from typing import TYPE_CHECKING
  import torch
  from avalanche.benchmarks.utils import concat_datasets
  from avalanche.models.utils import avalanche_forward
  from avalanche.training.plugins.strategy_plugin import SupervisedPlugin
  from avalanche.training.storage_policy import ClassBalancedBuffer
label_desc: Use image node_id 2 for calling a global function with example usage: update_temp(model, grad, lr) and returns: model_copy