MCPcopy Index your code
hub / github.com/bitsandbytes-foundation/bitsandbytes / get_ptr

Function get_ptr

bitsandbytes/functional.py:434–446  ·  view source on GitHub ↗

Gets the memory address of the first element of a tenso Args: A (`Optional[Tensor]`): A PyTorch tensor. Returns: `Optional[ct.c_void_p]`: A pointer to the underlying tensor data.

(A: Optional[Tensor])

Source from the content-addressed store, hash-verified

432
433
434def get_ptr(A: Optional[Tensor]) -> Optional[ct.c_void_p]:
435 """Gets the memory address of the first element of a tenso
436
437 Args:
438 A (`Optional[Tensor]`): A PyTorch tensor.
439
440 Returns:
441 `Optional[ct.c_void_p]`: A pointer to the underlying tensor data.
442 """
443 if A is None:
444 return None
445
446 return ct.c_void_p(A.data_ptr())
447
448
449class QuantState:

Callers 15

_dequantize_4bit_implFunction · 0.90
_gemv_4bit_implFunction · 0.90
_Function · 0.90
_int8_linear_matmul_implFunction · 0.90
_Function · 0.90
_dequantize_4bit_implFunction · 0.90
_gemv_4bit_implFunction · 0.90
prefetch_tensorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…