code: def _PruneParametersForSharing(model):
      assert model._shared_model
      master_prefix = "{}_{}/".format(
          model._device_prefix, model._devices[0]
      )
  
      # Remove non-master parameters so that they will not receive parameter
      # update operators.
      model.params = model.GetParams(master_prefix)
      paramset = set(model.params)
  
      model.param_to_grad = {
          p: model.param_to_grad[p]
          for p in model.param_to_grad
          if p in paramset
      }
      model.weights = [w for w in model.weights if w in paramset]
      model.biases = [w for w in model.biases if w in paramset]
  
imports: from collections import OrderedDict
  import logging
  import copy
  from multiprocessing import cpu_count
  from caffe2.python import model_helper, dyndep, scope, workspace, core, memonger, utils
  from caffe2.proto import caffe2_pb2
  import numpy
  import warnings
label_desc: Use image node_id 30 for calling a global function with example usage: _PruneParametersForSharing(model) without return types