Skip to content

Commit af449d3

Browse files
committed
removed ggml_n_dims_t
1 parent 263de2e commit af449d3

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

lora.hpp

+1-9
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,6 @@ struct LoraModel : public GGMLModule {
3333
return model_loader.get_params_mem_size(NULL);
3434
}
3535

36-
static inline int ggml_n_dims_t(const struct TensorStorage tensor) {
37-
for (int i = GGML_MAX_DIMS - 1; i >= 1; --i) {
38-
if (tensor.ne[i] > 1) {
39-
return i + 1;
40-
}
41-
}
42-
return 1;
43-
}
4436

4537
bool load_from_file() {
4638
LOG_INFO("loading LoRA from '%s'", file_path.c_str());
@@ -57,7 +49,7 @@ struct LoraModel : public GGMLModule {
5749
if (dry_run) {
5850
struct ggml_tensor* real = ggml_new_tensor(params_ctx,
5951
tensor_storage.type,
60-
ggml_n_dims_t(tensor_storage),
52+
tensor_storage.n_dims,
6153
tensor_storage.ne);
6254
lora_tensors[name] = real;
6355
} else {

0 commit comments

Comments
 (0)