code: def swig_ptr_from_IntTensor(x):
      """gets a Faiss SWIG pointer from a pytorch tensor (on CPU or GPU)"""
      assert x.is_contiguous()
      assert x.dtype == torch.int32, "dtype=%s" % x.dtype
      return faiss.cast_integer_to_int_ptr(
          x.storage().data_ptr() + x.storage_offset() * 4
      )
  
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 4 for calling a global function with example usage: swig_ptr_from_IntTensor(x) and returns: faiss