Changed dimension naming to rank

This commit is contained in:
2023-05-07 13:31:04 +02:00
parent 5a86badd43
commit 836e113d32
2 changed files with 31 additions and 31 deletions

View File

@@ -28,7 +28,7 @@ typedef float dtype;
typedef struct _tensor {
dtype *elements;
int dimension;
int rank;
int *size;
int *index_offsets;
int num_elem;
@@ -47,9 +47,9 @@ int _tensor_set_size(tensor t, const int *size, int dim);
int tensor_set(tensor t, const int *index, dtype val);
dtype tensor_get(const tensor t, const int *index, int *success);
int tensor_init_one(tensor t, int dimension, const int *size);
int tensor_init_zero(tensor t, int dimension, const int *size);
int tensor_init_rand(tensor t, int dimension, const int *size, dtype max);
int tensor_init_one(tensor t, int rank, const int *size);
int tensor_init_zero(tensor t, int rank, const int *size);
int tensor_init_rand(tensor t, int rank, const int *size, dtype max);
int tensor_cpy(tensor t1, const tensor t2);
void tensor_add_scalar(tensor t, dtype n);