MCPcopy
hub / github.com/NVIDIA/TensorRT-LLM / DLTensor

Class DLTensor

tensorrt_llm/_dlpack_utils.py:47–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45
46
47class DLTensor(ctypes.Structure):
48 _fields_ = [
49 ("data", c_void_p), # Data pointer
50 ("device", DLDevice), # Device information
51 ("ndim", c_int), # Number of dimensions
52 ("dtype", DLDataType), # Data type
53 ("shape", POINTER(c_int64)), # Pointer to array of dimension sizes
54 (
55 "strides",
56 POINTER(c_int64),
57 ), # Pointer to strides array (can be NULL for default contiguous layout)
58 ("byte_offset", c_size_t), # Byte offset (usually 0)
59 ]
60
61
62# Deleter type for DLManagedTensor

Callers 1

create_dlpack_capsuleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected