add macro MIN MAX in toom_t, and add copy tensor and weight_in neurons

This commit is contained in:
2024-06-11 21:40:39 +02:00
parent b3de7fb171
commit 99e87a7b5b
11 changed files with 110 additions and 1 deletions
+7
View File
@@ -129,6 +129,13 @@ tensor_##type* CLONE_TENSOR_##type(tensor_##type *tens){\
}\
return NULL;\
}\
\
void copy_tensor_##type(tensor_##type * dst, tensor_##type * src){\
if(dst!=NULL && src!=NULL && dst->dim->rank == src->dim->rank){ \
for(size_t i=0; i<(dst->dim)->rank;++i)\
dst->x[i]=src->x[i];\
}\
}\
\
void free_tensor_##type(tensor_##type * tens){\
if(tens){\
+1
View File
@@ -20,6 +20,7 @@ tensor_##type* CREATE_TENSOR_FROM_CPY_DIM_##type(dimension *dim);\
void _RECREATE_TENSOR_IF_NOT_THE_SAME_DIM_OR_NULL_##type(tensor_##type **M, dimension *dd);\
tensor_##type* CLONE_TENSOR_##type(tensor_##type *tens);\
void free_tensor_##type(tensor_##type * tens); \
void copy_tensor_##type(tensor_##type * dst, tensor_##type * src);\
tensor_##type * sub_minus_tensor_head_##type(tensor_##type *rootens, size_t minuSubdim, size_t rankInDim); \
tensor_##type * sub_minus_tensor_tail_##type(tensor_##type *rootens, size_t minuSubdim, size_t rankInDim); \
tensor_##type * sub_tensor_head_##type(tensor_##type *rootens, size_t subdim, size_t rankInDim); \