pimm.utils.comm.reduce_dict#

reduce_dict(input_dict, average=True)[source]#

Reduce the values in the dictionary from all processes so that process with rank 0 has the reduced results. :param input_dict: inputs to be reduced. All the values must be scalar CUDA Tensor. :type input_dict: dict :param average: whether to do average or sum :type average: bool

Returns:

a dict with the same keys as input_dict, after reduction.