Skip to content

Commit 6bac190

Browse files
committed
more strict assert
1 parent 2b8460b commit 6bac190

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

examples/llava/clip.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3057,12 +3057,14 @@ bool clip_image_batch_encode(clip_ctx * ctx, const int n_threads, const clip_ima
30573057

30583058
auto set_input_f32 = [&get_inp_tensor](const char * name, std::vector<float> & values) {
30593059
ggml_tensor * cur = get_inp_tensor(name);
3060+
GGML_ASSERT(cur->type == GGML_TYPE_F32);
30603061
GGML_ASSERT(ggml_nelements(cur) == (int64_t)values.size());
30613062
ggml_backend_tensor_set(cur, values.data(), 0, ggml_nbytes(cur));
30623063
};
30633064

30643065
auto set_input_i32 = [&get_inp_tensor](const char * name, std::vector<int32_t> & values) {
30653066
ggml_tensor * cur = get_inp_tensor(name);
3067+
GGML_ASSERT(cur->type == GGML_TYPE_I32);
30663068
GGML_ASSERT(ggml_nelements(cur) == (int64_t)values.size());
30673069
ggml_backend_tensor_set(cur, values.data(), 0, ggml_nbytes(cur));
30683070
};

0 commit comments

Comments
 (0)