Skip to main content

TensorTypes.h File

Tensor dtype/layout and minimal DLPack-like structs. More...

Included Headers

#include <cstdint>

Namespaces Index

namespacesimaai
namespaceneat
namespacedlpack

Classes Index

structDLDevice
structDLDataType
structDLTensor
structDLManagedTensor

Description

Tensor dtype/layout and minimal DLPack-like structs.

File Listing

The file content with the documentation metadata removed is:

1
6#pragma once
7
8#include <cstdint>
9
10namespace simaai::neat {
11
12// Minimal DLPack-like structs (CPU only). This keeps a zero-copy bridge path
13// for future bindings without adding a hard dependency today.
14namespace dlpack {
15
16enum class DLDeviceType : int {
17 kDLCPU = 1,
18};
19
20struct DLDevice {
23};
24
25enum DLDataTypeCode : uint8_t {
26 kDLInt = 0,
27 kDLUInt = 1,
29};
30
31struct DLDataType {
32 uint8_t code;
33 uint8_t bits;
34 uint16_t lanes;
35};
36
37struct DLTensor {
38 void* data;
40 int ndim;
42 int64_t* shape;
43 int64_t* strides;
44 uint64_t byte_offset;
45};
46
50 void (*deleter)(DLManagedTensor* self);
51};
52
53} // namespace dlpack
54
55enum class TensorDType {
56 UInt8,
57 Int8,
58 UInt16,
59 Int16,
60 Int32,
64};
65
66enum class TensorLayout {
67 Unknown = 0,
68 HWC,
69 CHW,
70 HW,
71 Planar,
72};
73
74} // namespace simaai::neat

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.1.