code: def reduce_mean(tensor):
      """ "Obtain the mean of tensor on different GPUs."""
      if not (dist.get_world_size() and dist.is_initialized()):
          return tensor
      tensor = tensor.clone()
      dist.all_reduce(
          tensor.divide(
              paddle.to_tensor(dist.get_world_size(), dtype="float32")
          ),
          op=dist.ReduceOp.SUM,
      )
      return tensor
  
imports: import copy
  import numpy
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from ppdet.core.workspace import register
  import paddle.distributed
  from ..transformers.petr_transformer import inverse_sigmoid, masked_fill
  from ..initializer import constant_, normal_
  from functools import partial
label_desc: Use image node_id 3 for calling a global function with example usage: reduce_mean(tensor) and returns: tensor, tensor