class_docstr: This is where BytePS's DistributedOptimizer wrapper for MXNet goes
class_docstr_tok: ["This","is","where","BytePS","'s","DistributedOptimizer","wrapper","for","MXNet","goes"]
code: def update(self, index, weight, grad, state):
      if self._enable_async:
          # create a tmp list for storing the original weight
          temp_weight_list = [w.copy() for w in weight]
          assert len(temp_weight_list) == len(weight)
  
          # update parameter locally
          self._optimizer.update(index, weight, grad, state)
  
          # get delta weight
          for i, temp_weight in enumerate(temp_weight_list):
              weight[i].__isub__(temp_weight)
  
          # push delta weight, and pull weight back to the same tensor
          self._do_push_pull_param(index, weight)
  
      else:
          self._do_push_pull(index, grad)
          self._optimizer.update(index, weight, grad, state)
  
imports: from __future__ import absolute_import, division, print_function
  import copy
  import os
  import struct
  import warnings
  import mxnet
  import mxnet.ndarray
  from byteps.mxnet.compression import Compression
  from byteps.mxnet.ops import byteps_declare_tensor, byteps_push_pull, init, local_rank, local_size, rank, resume, shutdown, size, suspend
label_desc: Use image node_id 6 for calling the DistributedOptimizer obj's underlying member method code with example usage: obj.update(index, weight, grad, state) without return types