code: def _cast_to_appropriate_type(ar, cast_type):
      if cast_type == "cp":
          return ar
  
      if cast_type == "pt":
          from torch.utils.dlpack import from_dlpack
  
      elif cast_type == "tf":
          from tensorflow.experimental.dlpack import from_dlpack
  
      return from_dlpack(ar.astype("int32").toDlpack())
  
file_path: cudf/python/cudf/cudf/core/subword_tokenizer.py
imports: from __future__ import annotations
  import warnings
  from typing import Union
  import cupy
  from cudf._lib.nvtext.subword_tokenize import Hashed_Vocabulary, subword_tokenize_inmem_hash
label_desc: Use image node_id 1 for calling a global function with example usage: _cast_to_appropriate_type(ar, cast_type) and returns: from_dlpack, ar