Merge 646e4d0c85 into 05a6f0e894
This commit is contained in:
commit
11c82a343c
|
|
@ -545,7 +545,14 @@ struct gguf_context * gguf_init_from_file_impl(FILE * file, struct gguf_init_par
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check for zero dimensions
|
||||||
|
if (ok && (info.t.ne[1] == 0 || info.t.ne[2] == 0 || info.t.ne[3] == 0)) {
|
||||||
|
GGML_LOG_ERROR("%s: tensor '%s' has zero dimension in shape "
|
||||||
|
"(%" PRIi64 ", %" PRIi64 ", %" PRIi64 ", %" PRIi64 ")\n",
|
||||||
|
__func__, info.t.name, info.t.ne[0], info.t.ne[1], info.t.ne[2], info.t.ne[3]);
|
||||||
|
ok = false;
|
||||||
|
}
|
||||||
// check that the total number of elements is representable
|
// check that the total number of elements is representable
|
||||||
if (ok && ((INT64_MAX/info.t.ne[1] <= info.t.ne[0]) ||
|
if (ok && ((INT64_MAX/info.t.ne[1] <= info.t.ne[0]) ||
|
||||||
(INT64_MAX/info.t.ne[2] <= info.t.ne[0]*info.t.ne[1]) ||
|
(INT64_MAX/info.t.ne[2] <= info.t.ne[0]*info.t.ne[1]) ||
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue