code: def metric_average(val, name):
      tensor = torch.tensor(val)
      avg_tensor = hvd.allreduce(tensor, name=name)
      return avg_tensor.item()
  
imports: import argparse
  import os
  import tempfile
  import horovod.torch
  import torch.nn
  import torch.nn.functional
  import torch.optim
  import torch.utils.data.distributed
  from filelock import FileLock
  from torchvision import datasets, transforms
  import ray.train.torch
  from ray import train
  from ray.train import Checkpoint, ScalingConfig
  from ray.train.horovod import HorovodTrainer
label_desc: Use image node_id 1 for calling a global function with example usage: metric_average(val, name) and returns: avg_tensor