From f7b8589b87e54f90e6611c58d82b9b5cc5dbcd59 Mon Sep 17 00:00:00 2001 From: Elias Kohout Date: Tue, 11 Apr 2023 20:04:23 +0200 Subject: [PATCH] Renaming of tensor_for_each_element and tensor_add/_sub. --- tensor.c | 6 +++--- tensor.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tensor.c b/tensor.c index 9a7f825..e34b127 100644 --- a/tensor.c +++ b/tensor.c @@ -223,7 +223,7 @@ void tensor_div_scalar(tensor t, dtype n) } } -int tensor_add(tensor t1, const tensor t2) +int tensor_add_inplace(tensor t1, const tensor t2) { assert(!tensor_is_empty(t1)); assert(!tensor_is_empty(t2)); @@ -239,7 +239,7 @@ int tensor_add(tensor t1, const tensor t2) return 1; } -int tensor_sub(tensor t1, const tensor t2) +int tensor_sub_inplace(tensor t1, const tensor t2) { assert(!tensor_is_empty(t1)); assert(!tensor_is_empty(t2)); @@ -255,7 +255,7 @@ int tensor_sub(tensor t1, const tensor t2) return 1; } -void tensor_for_each_elem(tensor t, dtype (*func)(dtype)) +void tensor_map(tensor t, dtype (*func)(dtype)) { assert(!tensor_is_empty(t)); diff --git a/tensor.h b/tensor.h index 13709a9..4e0a588 100644 --- a/tensor.h +++ b/tensor.h @@ -55,10 +55,10 @@ void tensor_add_scalar(tensor t, dtype n); void tensor_sub_scalar(tensor t, dtype n); void tensor_mult_scalar(tensor t, dtype n); void tensor_div_scalar(tensor t, dtype n); -int tensor_add(tensor t1, const tensor t2); -int tensor_sub(tensor t1, const tensor t2); +int tensor_add_inplace(tensor t1, const tensor t2); +int tensor_sub_inplace(tensor t1, const tensor t2); -void tensor_for_each_elem(tensor t, dtype (*func)(dtype)); +void tensor_map(tensor t, dtype (*func)(dtype)); void tensor_print(const tensor t); #endif