code: def update(self, val):
      self.sum += hvd.allreduce(val.detach().cpu(), name=self.name)
      self.n += 1
  
imports: import argparse
  import os
  import numpy
  from tqdm import tqdm
  import torch
  import torch.nn
  import torch.nn.functional
  import torch.optim
  from torchvision import datasets, transforms
  import horovod.torch
  from horovod.torch.elastic.sampler import ElasticSampler
  from horovod.ray import ray_logger
  from horovod.ray.elastic import TestDiscovery
label_desc: Use image node_id 2 for calling the Metric obj's underlying member method code with example usage: obj.update(val) without return types