code: def _output_to_array(self, output):
      if (
          torch.is_tensor(output) or isinstance(output, np.ndarray)
      ) and len(output.shape) == 0:
          values = [float(output)]
      elif isinstance(output, Mapping):
          values = [float(output[name]) for name in self.names]
      elif isinstance(output, Iterable):
          values = [float(metric) for metric in output]
      else:
          values = [float(output)]
      return np.array(values)
  
file_path: poutyne/poutyne/framework/metrics/decomposable.py
imports: from typing import Iterable, Mapping
  import numpy
  import torch
  import torch.nn
  from poutyne.framework.metrics.base import Metric
  from poutyne.utils import get_batch_size
label_desc: Use image node_id 5 for calling the DecomposableMetric obj's underlying member method code with example usage: obj._output_to_array(output) and returns: np