code: def all_reduce_mean(tensor: torch.Tensor) -> torch.Tensor:
      """
      Wrapper over torch.distributed.all_reduce for performing mean reduction
      of tensor over all processes.
      """
      return all_reduce_op(
          tensor,
          torch.distributed.ReduceOp.SUM,
          lambda t: t / torch.distributed.get_world_size(),
      )
  
imports: import io
  import tempfile
  from typing import Any, Callable, List, Tuple
  import torch
label_desc: Use image node_id 5 for calling a global function with example usage: all_reduce_mean(tensor) and returns: all_reduce_op