class_docstr: FATECommunicator is a wrapper around the FATE communicator.
class_docstr_tok: ["FATECommunicator","is","a","wrapper","around","the","FATE","communicator","."]
code: def broadcast(self, input, src, group=None, batched=False):
      self._assert_initialized()
      group = self.main_group if group is None else group
      if batched:
          assert isinstance(
              input, list
          ), "batched reduce input must be a list"
          reqs = []
          for tensor in input:
              reqs.append(
                  self.broadcast(
                      tensor.data, src, group=group, batched=False
                  )
              )
      else:
          send_index = group.tensor_send_index_inc()
          recv_index = group.tensor_recv_index_inc()
          if src == self.rank:
              self._send_many(
                  index=send_index,
                  tensor=input,
                  dst_list=[
                      rank for rank in group.ranks if rank != self.rank
                  ],
                  group=group,
              )
              return input
          else:
              recv_tensor = self._recv(
                  index=recv_index,
                  tensor=input,
                  src=src,
                  group=group,
              )
              if input is not None:
                  input.copy_(recv_tensor)
                  return input
              else:
                  return recv_tensor
  
imports: import functools
  import logging
  import sys
  import timeit
  from concurrent.futures import ThreadPoolExecutor
  import torch
  from torch.distributed import ReduceOp
  from torch.distributed import ReduceOp
  from fate.arch.context import Context, NS, Parties
  from fate.arch import trace
  from typing import List
label_desc: Use image node_id 22 for calling the Communicator obj's underlying member method code with example usage: obj.broadcast(input, src, group, batched) and returns: input, input, recv_tensor