parameters: (self, input, output, mode="sum")
docstring: all reduce between trainers if current role is TRAINER,
          only support array of one dim.
  
          Args:
              input(list/numpy.array): array of one dim
              output(list/numpy.array): array of one dim
              mode(str): "sum" or "min" or "max"
docstring_summary: all reduce between trainers if current role is TRAINER,
          only support array of one dim.
docstring_tokens: all reduce between trainers if current role is TRAINER only support array of one dim .
function: def all_reduce_worker(self, input, output, mode="sum"):
          """
          all reduce between trainers if current role is TRAINER,
          only support array of one dim.
  
          Args:
              input(list/numpy.array): array of one dim
              output(list/numpy.array): array of one dim
              mode(str): "sum" or "min" or "max"
          """
          if not self._role_is_generated:
              self.generate_role()
          if not self.is_worker():
              print("warning: current role is not worker in all_reduce_worker")
              return
          self._all_reduce(input, output, mode)
function_tokens: def all_reduce_worker ( self , input , output , mode = "sum" ) : if not self . _role_is_generated : self . generate_role ( ) if not self . is_worker ( ) : print ( "warning: current role is not worker in all_reduce_worker" ) return self . _all_reduce ( input , output , mode )