MCPcopy Create free account
hub / github.com/LMCache/LMCache / _is_ptr_tensor

Function _is_ptr_tensor

lmcache/python_ops_fallback.py:806–812  ·  view source on GitHub ↗

Return True when *x* is a 1-D pointer tensor (int64 or uint64).

(x: object)

Source from the content-addressed store, hash-verified

804
805
806def _is_ptr_tensor(x: object) -> bool:
807 """Return True when *x* is a 1-D pointer tensor (int64 or uint64)."""
808 return (
809 isinstance(x, torch.Tensor)
810 and x.dtype in (torch.int64, torch.uint64)
811 and x.ndim == 1
812 )
813
814
815def _per_layer_paged_shape(

Callers 2

_infer_kv_dtypeFunction · 0.85
_normalize_paged_layersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected