code: def swig_ptr_from_UInt8Tensor(x):
      """gets a Faiss SWIG pointer from a pytorch tensor (on CPU or GPU)"""
      assert x.is_contiguous()
      assert x.dtype == torch.uint8
      return faiss.cast_integer_to_uint8_ptr(
          x.storage().data_ptr() + x.storage_offset()
      )
  
file_path: faiss/contrib/torch_utils.py
imports: import faiss
  import torch
  import contextlib
  import inspect
  import sys
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: swig_ptr_from_UInt8Tensor(x) and returns: faiss