code: def check(first_device, *inputs) -> None:
      """
      Checks whether the input contains at least one tensor and each tensor is
      on the same device as the first partition.
  
      Raises:
          ValueError: input does not contain at least one tensor
  
      """
  
      if not any(torch.is_tensor(input) for input in inputs):
          raise TypeError(f"inputs do not have any tensors: {inputs}")
      if any(
          torch.is_tensor(input) and input.device != first_device
          for input in inputs
      ):
          raise ValueError(
              "All inputs should be on the same device as the first partition"
          )
  
imports: import typing
  from typing import Any, Callable, List, Union, cast, Sequence
  import torch
  from torch import Tensor
  import torch.cuda.comm
label_desc: Use image node_id 1 for calling a global function with example usage: check(first_device) without return types