code: def _register_py_tensor_class_for_device(device, cls):
      if not isinstance(cls, type):
          raise RuntimeError("cls isn't a typeinfo object")
      torch._C._register_py_class_for_device(device, cls)
  
imports: import warnings
  from typing import Any, Callable, cast, List, Optional, Sequence, Tuple, Union
  import torch
  from torch.types import _size, _TensorOrTensors, _TensorOrTensorsOrGradEdge
  from ..None import _vmap_internals
  from ..overrides import handle_torch_function, has_torch_function, is_tensor_like
  from .None import forward_ad, functional, graph
  from .anomaly_mode import detect_anomaly, set_detect_anomaly
  from .function import Function, NestedIOFunction
  from .grad_mode import _force_original_view_tracking, _unsafe_preserve_version_counter, enable_grad, inference_mode, no_grad, set_grad_enabled, set_multithreading_enabled
  from .gradcheck import gradcheck, gradgradcheck
  from .graph import _engine_run_backward
  from .variable import Variable
  from torch._C._autograd import _add_metadata_json, _disable_profiler, _disable_profiler_legacy, _enable_profiler, _enable_profiler_legacy, _enable_record_function, _get_sequence_nr, _kineto_step, _KinetoEvent, _pop_saved_tensors_default_hooks, _prepare_profiler, _profiler_enabled, _ProfilerResult, _push_saved_tensors_default_hooks, _record_function_with_args_enter, _record_function_with_args_exit, _set_empty_test_observer, _supported_activities, DeviceType, kineto_available, ProfilerEvent, SavedTensor
  from torch._C._profiler import ProfilerActivity, ProfilerConfig, ProfilerState
  from .None import profiler
label_desc: Use image node_id 8 for calling a global function with example usage: _register_py_tensor_class_for_device(device, cls) without return types