code: def test_to_device() -> None:
      """
      There doesn't seem to be an easy way to mock out PyTorch devices, so ignore
      testing that the data makes it *on* to the device.
      """
      data_structure = {
          "input_1": torch.Tensor(1),
          "input_3": "str",
          "input_4": 1,
      }
  
      assert to_device(data_structure, "cpu") == data_structure
      assert np.array_equal(
          to_device(np.array([0, 1, 2]), "cpu"), np.array([0, 1, 2])
      )
  
imports: import logging
  import queue
  import typing
  from logging import handlers
  import numpy
  import pytest
  import torch
  import determined
  from determined.pytorch import data_length, samplers, to_device
label_desc: Use image node_id 16 for calling a global function with example usage: test_to_device() without return types