Skip to content

Commit 714489f

Browse files
committed
cont : remove unnecessary overload
1 parent 300a50e commit 714489f

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

ggml/src/ggml-impl.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,10 @@ static inline bool ggml_can_fuse_ext(const struct ggml_cgraph * cgraph, const in
606606
static inline bool ggml_can_fuse(const struct ggml_cgraph * cgraph, int node_idx, const enum ggml_op * ops, int num_ops) {
607607
assert(num_ops < 32);
608608

609+
if (node_idx + num_ops > cgraph->n_nodes) {
610+
return false;
611+
}
612+
609613
int idxs[32];
610614
for (int i = 0; i < num_ops; ++i) {
611615
idxs[i] = node_idx + i;
@@ -627,11 +631,6 @@ inline bool ggml_can_fuse(const struct ggml_cgraph * cgraph, int node_idx, std::
627631
return ggml_can_fuse(cgraph, node_idx, ops.begin(), (int)ops.size());
628632
}
629633

630-
inline bool ggml_can_fuse(const struct ggml_cgraph * cgraph, std::initializer_list<int> node_idx, std::initializer_list<enum ggml_op> ops) {
631-
assert(node_idx.size() == ops.size());
632-
return ggml_can_fuse_ext(cgraph, node_idx.begin(), ops.begin(), (int)ops.size());
633-
}
634-
635634
// expose GGUF internals for test code
636635
GGML_API size_t gguf_type_size(enum gguf_type type);
637636
GGML_API struct gguf_context * gguf_init_from_file_impl(FILE * file, struct gguf_init_params params);

0 commit comments

Comments
 (0)