| 45 | |
| 46 | |
| 47 | class 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 |
no outgoing calls
no test coverage detected