code: def _is_cuda(tensor):
      """Check if a tensor is not none and is cuda."""
      assert tensor is not None
      assert tensor.is_cuda
  
file_path: megatron-lm/megatron/text_generation/communication.py
imports: import torch
  from megatron.core import mpu
label_desc: Use image node_id 3 for calling a global function with example usage: _is_cuda(tensor) without return types