code: def update(self, val, n=1):
      assert isinstance(val, mx.nd.NDArray), type(val)
      if self.sum is None:  # init sum
          self.sum = mx.nd.zeros_like(val)
  
      self.sum += val * n
      self.count += n
  
imports: import logging
  import os
  import sys
  import time
  import horovod.mxnet
  import mxnet
  from mxboard import SummaryWriter
  from mxnet import nd
  from default import config
  from evaluation import verification
label_desc: Use image node_id 3 for calling the MetricNdarray obj's underlying member method code with example usage: obj.update(val, n) without return types