code: def _item(x):
      if isinstance(x, torch.Tensor):
          x = x.item()
      return x
  
file_path: pyro/tests/poutine/test_counterfactual.py
imports: import pytest
  import torch
  import pyro
  import pyro.distributions
  import pyro.poutine
  from tests.common import assert_equal, assert_not_equal
label_desc: Use image node_id 1 for calling a global function with example usage: _item(x) and returns: x