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 __init__(self, optimizer):
      self._optimizer = optimizer
      self._enable_async = int(os.getenv("BYTEPS_ENABLE_ASYNC", 0)) != 0
      if self._enable_async:
          assert (
              int(os.getenv("DMLC_NUM_WORKER")) > 1
          ), "Async is only valid for distributed training"
          print("BytePS: enable asynchronous training")
  
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 1 to create a new DistributedOptimizer object from inherited base classes: mx.optimizer with example: obj = DistributedOptimizer(optimizer)