class_docstr: Wrapper class for the basic BlueFog API.
class_docstr_tok: ["Wrapper","class","for","the","basic","BlueFog","API","."]
docstr: A function that initializes BlueFog.
  
  Args:
    topology_fn: A callable function that takes size as input and return
      networkx.DiGraph object to decide the topology. If not provided
      a default exponential graph (base 2) structure is called.
    is_weighted: If set to true, the neighbor ops like (win_update, neighbor_allreduce) will
      execute the weighted average instead, where the weight is the value used in
      topology matrix (including self).
docstr_tok: ["A","function","that","initializes","BlueFog",".","Args",":","topology_fn",":","A","callable","function","that","takes","size","as","input","and","return","networkx.DiGraph","object","to","decide","the","topology",".","If","not","provided","a","default","exponential","graph","(","base","2",")","structure","is","called",".","is_weighted",":","If","set","to","true",",","the","neighbor","ops","like","(","win_update",",","neighbor_allreduce",")","will","execute","the","weighted","average","instead",",","where","the","weight","is","the","value","used","in","topology","matrix","(","including","self",")","."]
code: def init(
      self,
      topology_fn: Optional[Callable[[int], networkx.DiGraph]] = None,
      is_weighted: bool = False,
  ):
      """A function that initializes BlueFog.
  
      Args:
        topology_fn: A callable function that takes size as input and return
          networkx.DiGraph object to decide the topology. If not provided
          a default exponential graph (base 2) structure is called.
        is_weighted: If set to true, the neighbor ops like (win_update, neighbor_allreduce) will
          execute the weighted average instead, where the weight is the value used in
          topology matrix (including self).
      """
      self._MPI_LIB_CTYPES.bluefog_init()
      if topology_fn:
          topo = topology_fn(self.size())
      else:
          topo = topology_util.ExponentialGraph(self.size())
      self.set_topology(topo, is_weighted)
      atexit.register(self.shutdown)
  
imports: from typing import List, Callable, Optional
  import atexit
  import contextlib
  import ctypes
  import logging
  import networkx
  import bluefog.common.util
  import bluefog.common.topology_util
label_desc: Use image node_id 2 for calling the BlueFogBasics obj's underlying member method code with example usage: obj.init(topology_fn, is_weighted) without return types