mirror of
https://github.com/leejet/stable-diffusion.cpp.git
synced 2026-11-10 19:06:33 +00:00
fix: set n_dims of tensor storage to 1 when it's 0
This commit is contained in:
1 parent
ce1bcc74a6
commit
1d2af5ca3f
1 file changed
+3
-4
@@ -888,10 +888,9 @@ bool ModelLoader::init_from_safetensors_file(const std::string& file_path, const
|
||||
}
|
||||
}
|
||||
|
||||
// ggml/src/ggml.c:2745
|
||||
if (n_dims < 1 || n_dims > GGML_MAX_DIMS) {
|
||||
LOG_ERROR("skip tensor '%s' with n_dims %d", name.c_str(), n_dims);
|
||||
continue;
|
||||
// ggml_n_dims returns 1 for scalars
|
||||
if (n_dims == 0) {
|
||||
n_dims = 1;
|
||||
}
|
||||
|
||||
TensorStorage tensor_storage(prefix + name, type, ne, n_dims, file_index, ST_HEADER_SIZE_LEN + header_size_ + begin);
|
||||
|
||||
Reference in new issue
Block a user