From 6ab63357f7ea7805cdc15a41de66ae6ec491bc1d Mon Sep 17 00:00:00 2001 From: lucasdelimanogueira <47654903+lucasdelimanogueira@users.noreply.github.com> Date: Mon, 29 Apr 2024 02:21:54 -0300 Subject: [PATCH] Delete src directory --- src/tensor.cpp | 67 ------------------------------------------------- src/tensor.h | 17 ------------- src/tensor.o | Bin 3760 -> 0 bytes 3 files changed, 84 deletions(-) delete mode 100644 src/tensor.cpp delete mode 100644 src/tensor.h delete mode 100644 src/tensor.o diff --git a/src/tensor.cpp b/src/tensor.cpp deleted file mode 100644 index bcdbcb9..0000000 --- a/src/tensor.cpp +++ /dev/null @@ -1,67 +0,0 @@ -#include -#include -#include "tensor.h" - -extern "C" { - - Tensor *create_tensor(float *data, int *shape, int ndim) { - Tensor *tensor = (Tensor *)malloc(sizeof(Tensor)); - if (tensor == NULL) { - fprintf(stderr, "Memory allocation failed\n"); - exit(1); - } - tensor->data = data; - tensor->shape = shape; - tensor->ndim = ndim; - - tensor->strides = (int *)malloc(ndim * sizeof(int)); - if (tensor->strides == NULL) { - fprintf(stderr, "Memory allocation failed\n"); - exit(1); - } - int stride = 1; - for (int i = ndim - 1; i >= 0; i--) { - tensor->strides[i] = stride; - stride *= shape[i]; - } - - printf("Tensor created successfully\n"); - printf("Tensor information:\n"); - printf("Number of dimensions: %d\n", tensor->ndim); - printf("Shape: ["); - for (int i = 0; i < ndim; i++) { - printf("%d", tensor->shape[i]); - if (i < ndim - 1) { - printf(", "); - } - } - printf("]\n"); - - printf("Data:\n["); - for (int i = 0; i < stride; i++) { - printf("%.2f", tensor->data[i]); - if (i < stride - 1) { - printf(", "); - } - } - printf("]\n"); - - - return tensor; - } - - float get_item(Tensor *tensor, int *indices) { - int index = 0; - for (int i = 0; i < tensor->ndim; i++) { - index += indices[i] * tensor->strides[i]; - } - return tensor->data[index]; - } - - void free_tensor(Tensor *tensor) { - free(tensor->data); - free(tensor->shape); - free(tensor->strides); - free(tensor); - } -} diff --git a/src/tensor.h b/src/tensor.h deleted file mode 100644 index f93b22a..0000000 --- a/src/tensor.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef TENSOR_H -#define TENSOR_H - -typedef struct { - float *data; - int *strides; - int *shape; - int ndim; -} Tensor; - -extern "C" { - Tensor *create_tensor(float *data, int *shape, int ndim); - float get_item(Tensor *tensor, int *indices); - void delete_tensor(Tensor* tensor); -} - -#endif /* TENSOR_H */ diff --git a/src/tensor.o b/src/tensor.o deleted file mode 100644 index 237b41a16cfd3e0137c3b44eef9fa27a20f509d5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3760 zcmbtWU1%It6h56peDOu_Nfd;>R*SYtp|Kbt^vMT>Cady}a9AC)xH@=+j)1fcUDwT+ z=#YJvgEz>DcNVWEO<;{}kc1 zQG48NFYfknR;$cbO?9`7AU^f)j zsIndEhD*USG+NJap&7hd58-9T`$u;WZ!5oG?ly|5mVHmlp6jmNyK~ye70hKdk92R*4%GcgDN+$JoDgJjT~KzaWRC`%#bQ18B; zYuNE;5T`*hhep8qLmvlD_3aH#1(4$EUUszr6`F-UV3FF@zs>bCEqdnaxvFiV%eDvp zdeo*sAlUIuMz}alt5wiFeJe)0pj(Yj_`Y_~<>P@mND%gSK*|5!HoO;+Cw%$4HAU=c z9Mm6K!U%N2U+RLN=z_B@_#0jD*)I57h*SO|Z@1@�^n-4PVG*EnCs(J6nh+-F5g z7K`9LFL4in_|)|5$%*Os?BwJ;I~zYcadMi)A?H4BP_j~nX+ruvGh-QGEM+VxmaP&L z%}m}(!$rf2qap`s(=dcXTEnxH6bjvW>cP$xL_<7RX!Z63l5A{Xl zIVSN(IX}{c|GLB%^_utb5BmI{llTkVf2s@rQ;DD9{Lj1auS@(a=YQLUe^=rcIR7Uf z-(R2m68~M!|JBF$pSPb1k0R>7>}_F)<5Yh?|ER0K}S z-spn&@K-72>E{o2!BymukUQ?u-ACQuCNAC^3lc8g8=#ezb5>#zXUp{FOJZdj*@R{p zOBQG;{2YR|SSo>L7Q9Weki%~%>hcB4(C`~KT(T0$%Y1(^U)G9dp=g-aGTM+Q<5E0r zCUOSPn65^kt1#VA&*U46ViH11&d5%kA z;JgfQz8wD;_bJo=t^Ej(@9#Z@680a_#wT+82b2pmX@;pKlhoM%K!iX