Added assertions, added index_offset array to improve performance when indexing, rewritten set_size

This commit is contained in:
2023-03-13 15:45:30 +01:00
parent 0b7ba4fa52
commit 91d25e5d54
2 changed files with 50 additions and 46 deletions

View File

@@ -5,6 +5,7 @@
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <assert.h>
#define PRINT_STRING " %4.1f "
@@ -14,6 +15,7 @@ typedef struct _tensor {
dtype *elements;
int dimension;
int *size;
int *index_offsets;
int num_elem;
} *tensor;