Skip to content

Commit

Permalink
ggml : fix assert in ggml_set_unary_op (ggerganov#2410)
Browse files Browse the repository at this point in the history
  • Loading branch information
slaren committed Jul 26, 2023
1 parent 6df1f59 commit b5472ea
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions ggml.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit b5472ea

Please sign in to comment.