code: def test_convert_tensor():
      x = torch.tensor([0.0])
      tensor = convert_tensor(x)
      assert torch.is_tensor(tensor)
  
      x = torch.tensor([0.0])
      tensor = convert_tensor(x, device="cpu", non_blocking=True)
      assert torch.is_tensor(tensor)
  
      x = torch.tensor([0.0])
      tensor = convert_tensor(x, device="cpu", non_blocking=False)
      assert torch.is_tensor(tensor)
  
      x = [torch.tensor([0.0]), torch.tensor([0.0])]
      list_ = convert_tensor(x)
      assert isinstance(list_, list)
      assert torch.is_tensor(list_[0])
      assert torch.is_tensor(list_[1])
  
      x = (torch.tensor([0.0]), torch.tensor([0.0]))
      tuple_ = convert_tensor(x)
      assert isinstance(tuple_, tuple)
      assert torch.is_tensor(tuple_[0])
      assert torch.is_tensor(tuple_[1])
  
      Point = namedtuple("Point", ["x", "y"])
      x = Point(torch.tensor([0.0]), torch.tensor([0.0]))
      tuple_ = convert_tensor(x)
      assert isinstance(tuple_, Point)
      assert torch.is_tensor(tuple_[0])
      assert torch.is_tensor(tuple_[1])
  
      x = {"a": torch.tensor([0.0]), "b": torch.tensor([0.0])}
      dict_ = convert_tensor(x)
      assert isinstance(dict_, dict)
      assert torch.is_tensor(dict_["a"])
      assert torch.is_tensor(dict_["b"])
  
      assert convert_tensor("a") == "a"
  
      with pytest.raises(TypeError):
          convert_tensor(12345)
  
file_path: ignite/tests/ignite/test_utils.py
imports: import logging
  import sys
  from collections import namedtuple
  import pytest
  import torch
  from packaging.version import Version
  from ignite.engine import Engine, Events
  from ignite.utils import convert_tensor, deprecated, hash_checkpoint, setup_logger, to_onehot
label_desc: Use image node_id 1 for calling a global function with example usage: test_convert_tensor() without return types