class_docstr: Generic gossip averaging object for multi-peer communication
  
  Args:
      msg (torch.Tensor): message used to initialize recv buffer
      graph (GraphManager): Subclass of GraphManager
      device: (torch.Device) device on which to initialize recv buffer
      mixing (MixingManager): Subclass of MixingManager
      logger (logging.Logger): Module used to log results
      rank (int): Rank of the current process
      world_size (int): World size of the current process
class_docstr_tok: ["Generic","gossip","averaging","object","for","multi-peer","communication","Args",":","msg","(","torch.Tensor",")",":","message","used","to","initialize","recv","buffer","graph","(","GraphManager",")",":","Subclass","of","GraphManager","device",":","(","torch.Device",")","device","on","which","to","initialize","recv","buffer","mixing","(","MixingManager",")",":","Subclass","of","MixingManager","logger","(","logging.Logger",")",":","Module","used","to","log","results","rank","(","int",")",":","Rank","of","the","current","process","world_size","(","int",")",":","World","size","of","the","current","process"]
docstr: Returns a generator mixing messages on the fly
docstr_tok: ["Returns","a","generator","mixing","messages","on","the","fly"]
code: def mix_out_msg_(
      self, out_msg: torch.Tensor, ps_weight: torch.Tensor
  ) -> Iterator[torch.Tensor]:
      """Returns a generator mixing messages on the fly"""
      self.refresh_mixing_weights_(residual_adjusted=True)
      self.ps_weight = ps_weight
  
      # check whether or not we need to communicate ps_weight
      if not self.regular:
          out_msg = torch.cat(
              [
                  out_msg,
                  cast(
                      torch.Tensor, self.ps_weight.type(out_msg.dtype)
                  ),
              ]
          )
  
      # check whether or not we need to create a buffer for each out-msg
      if self._mixing_manager.is_uniform():
          weight = self.mixing_weights["uniform"]
          out_msg *= weight.type(out_msg.dtype)
          for _ in self.out_edges:
              yield out_msg
      else:
          for out_edge in self.out_edges:
              weight = self.mixing_weights[out_edge.dest]
              yield out_msg.mul(weight.type(out_msg.dtype))
  
imports: from enum import Enum
  import logging
  from typing import Iterator, List, Optional, Tuple, cast
  import torch
  import torch.distributed
  from .graph_manager import GraphManager
  from .mixing_manager import MixingManager, UniformMixing
label_desc: Use image node_id 8 for calling the Gossiper obj's underlying member method code with example usage: obj.mix_out_msg_(out_msg, ps_weight) without return types