vulkan: support more CONCAT types (#24579)

This commit is contained in:
Jeff Bolz
2026-06-15 13:19:21 +02:00
committed by GitHub
parent 6eab47181c
commit 9dbc6621ae
3 changed files with 36 additions and 18 deletions
+3 -3
View File
@@ -130,12 +130,12 @@ static void init_tensor_uniform(ggml_tensor * tensor, float min = -1.0f, float m
}
}
ggml_backend_tensor_set(tensor, dataq.data(), 0, dataq.size());
} else if (tensor->type == GGML_TYPE_I8 || tensor->type == GGML_TYPE_I16 || tensor->type == GGML_TYPE_I32) {
} else if (tensor->type == GGML_TYPE_I8 || tensor->type == GGML_TYPE_I16) {
// This is going to create some weird integers though.
ggml_backend_tensor_set(tensor, data.data(), 0, ggml_nbytes(tensor));
ggml_backend_tensor_set(tensor, data.data(), 0, nels * ggml_type_size(tensor->type));
} else if (tensor->type == GGML_TYPE_I64) {
// Integers with a size of 8 bytes can be set by mirroring the float data, the specific values are again not really meaningful.
const size_t nbytes_half = ggml_nbytes(tensor)/2;
const size_t nbytes_half = nels * sizeof(float);
ggml_backend_tensor_set(tensor, data.data(), 0*nbytes_half, nbytes_half);
ggml_backend_tensor_set(tensor, data.data(), 1*nbytes_half, nbytes_half);
} else {