docstr: Create mixing weight dictionary using uniform allocation
docstr_tok: ["Create","mixing","weight","dictionary","using","uniform","allocation"]
code: def get_mixing_weights(
      self, residual_adjusted: bool = True
  ) -> Dict[Union[str, int], torch.Tensor]:
      """Create mixing weight dictionary using uniform allocation"""
      mixing_weights: Dict[Union[str, int], torch.Tensor] = {}
      out_peers, _ = self.graph_manager.get_peers()
  
      w = torch.tensor(
          [1.0 / (len(out_peers) + 1.0)], device=self.device
      )
      mixing_weights["lo"] = w.clone()
      w_op = w if not residual_adjusted else w / mixing_weights["lo"]
      mixing_weights["uniform"] = w_op.clone()
      for op in out_peers:
          mixing_weights[op] = w_op.clone()
      return mixing_weights
  
file_path: fairscale/fairscale/experimental/nn/data_parallel/gossip/mixing_manager.py
imports: from abc import ABC, abstractmethod
  from typing import Dict, Optional, Union
  import torch
  from .graph_manager import GraphManager
label_desc: Use image node_id 1 for calling the UniformMixing obj's underlying member method code with example usage: obj.get_mixing_weights(residual_adjusted) and returns: mixing_weights