aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorslaren <slarengh@gmail.com>2023-07-26 23:57:23 +0200
committerGitHub <noreply@github.com>2023-07-26 23:57:23 +0200
commitb5472ea0ada081a6e1c06998ebbc9a24aa2cd4a4 (patch)
treef49c3803cb2811a6720798081590fb46e8dd3206
parent6df1f5940f889adde32fe47dc8881f010dcf9aba (diff)
ggml : fix assert in ggml_set_unary_op (#2410)
-rw-r--r--ggml.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/ggml.c b/ggml.c
index 33459f2..b77f992 100644
--- a/ggml.c
+++ b/ggml.c
@@ -4982,11 +4982,6 @@ enum ggml_unary_op ggml_get_unary_op(const struct ggml_tensor * tensor) {
return (enum ggml_unary_op) ggml_get_op_params_i32(tensor, 0);
}
-static void ggml_set_unary_op(struct ggml_tensor * tensor, enum ggml_unary_op op) {
- GGML_ASSERT(tensor->op = GGML_OP_UNARY);
- ggml_set_op_params_i32(tensor, 0, (int32_t) op);
-}
-
const char * ggml_get_name(const struct ggml_tensor * tensor) {
return tensor->name;
}
@@ -7226,7 +7221,7 @@ static struct ggml_tensor * ggml_unary_impl(
struct ggml_tensor * result = inplace ? ggml_view_tensor(ctx, a) : ggml_dup_tensor(ctx, a);
- ggml_set_unary_op(result, op);
+ ggml_set_op_params_i32(result, 0, (int32_t) op);
result->op = GGML_OP_UNARY;
result->grad = is_node ? ggml_dup_tensor(ctx, result) : NULL;