Skip to content

Commit 38b6821

Browse files
committed
tensor
1 parent b940322 commit 38b6821

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

pufferlib/src/tensor.h

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#ifndef PUFFERLIB_TENSOR_H
2+
#define PUFFERLIB_TENSOR_H
3+
4+
#include <stdint.h>
5+
6+
#define PUF_MAX_DIMS 8
7+
8+
typedef struct {
9+
float* data;
10+
int64_t shape[PUF_MAX_DIMS];
11+
} FloatTensor;
12+
13+
typedef struct {
14+
double* data;
15+
int64_t shape[PUF_MAX_DIMS];
16+
} DoubleTensor;
17+
18+
typedef struct {
19+
unsigned char* data;
20+
int64_t shape[PUF_MAX_DIMS];
21+
} ByteTensor;
22+
23+
typedef struct {
24+
long* data;
25+
int64_t shape[PUF_MAX_DIMS];
26+
} LongTensor;
27+
28+
typedef struct {
29+
int* data;
30+
int64_t shape[PUF_MAX_DIMS];
31+
} IntTensor;
32+
33+
#endif // PUFFERLIB_TENSOR_H

0 commit comments

Comments
 (0)