add explicit cast to fix compile error
"error: non-constant-expression cannot be narrowed from type 'int64_t' (aka 'long long') to 'uint32_t' (aka 'unsigned int') in initializer list [-Wc++11-narrowing]"
This commit is contained in:
parent
f88fb2bdc5
commit
01fc3faf71
1 changed files with 4 additions and 1 deletions
|
@ -1788,7 +1788,10 @@ void write_tensor(struct llama_file * file, struct ggml_tensor * tensor) {
|
||||||
const char * name = ggml_get_name(tensor);
|
const char * name = ggml_get_name(tensor);
|
||||||
uint32_t name_len = strlen(name);
|
uint32_t name_len = strlen(name);
|
||||||
uint32_t nd = tensor->n_dims;
|
uint32_t nd = tensor->n_dims;
|
||||||
uint32_t ne[4] = { tensor->ne[0], tensor->ne[1], tensor->ne[2], tensor->ne[3] };
|
uint32_t ne[4] = { (uint32_t)tensor->ne[0],
|
||||||
|
(uint32_t)tensor->ne[1],
|
||||||
|
(uint32_t)tensor->ne[2],
|
||||||
|
(uint32_t)tensor->ne[3] };
|
||||||
file->write_u32(nd);
|
file->write_u32(nd);
|
||||||
file->write_u32(name_len);
|
file->write_u32(name_len);
|
||||||
file->write_u32(tensor->type);
|
file->write_u32(tensor->type);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue