Skip to content

Commit b5472ea

Browse files
authored
ggml : fix assert in ggml_set_unary_op (#2410)
1 parent 6df1f59 commit b5472ea

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

ggml.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4982,11 +4982,6 @@ enum ggml_unary_op ggml_get_unary_op(const struct ggml_tensor * tensor) {
49824982
return (enum ggml_unary_op) ggml_get_op_params_i32(tensor, 0);
49834983
}
49844984

4985-
static void ggml_set_unary_op(struct ggml_tensor * tensor, enum ggml_unary_op op) {
4986-
GGML_ASSERT(tensor->op = GGML_OP_UNARY);
4987-
ggml_set_op_params_i32(tensor, 0, (int32_t) op);
4988-
}
4989-
49904985
const char * ggml_get_name(const struct ggml_tensor * tensor) {
49914986
return tensor->name;
49924987
}
@@ -7226,7 +7221,7 @@ static struct ggml_tensor * ggml_unary_impl(
72267221

72277222
struct ggml_tensor * result = inplace ? ggml_view_tensor(ctx, a) : ggml_dup_tensor(ctx, a);
72287223

7229-
ggml_set_unary_op(result, op);
7224+
ggml_set_op_params_i32(result, 0, (int32_t) op);
72307225

72317226
result->op = GGML_OP_UNARY;
72327227
result->grad = is_node ? ggml_dup_tensor(ctx, result) : NULL;

0 commit comments

Comments
 (0)