code: def _get_value_on_cpu(v: Any) -> Any:
      if isinstance(v, Metric):
          v = v.compute()
      if isinstance(v, torch.Tensor):
          v = v.cpu()
      return v
  
file_path: ignite/ignite/metrics/metrics_lambda.py
imports: import itertools
  from typing import Any, Callable, Optional, Union
  import torch
  from ignite.engine import Engine
  from ignite.metrics.metric import EpochWise, Metric, MetricUsage, reinit__is_reduced
label_desc: Use image node_id 1 for calling a global function with example usage: _get_value_on_cpu(v) and returns: v