Add GGML_OP_REDUCE

This commit is contained in:
Kawrakow
2025-12-19 08:27:24 +00:00
parent ea798acd10
commit 158f2f03f1
2 changed files with 108 additions and 3 deletions

View File

@@ -689,6 +689,8 @@ extern "C" {
GGML_OP_GLU,
GGML_OP_REDUCE,
GGML_OP_COUNT,
};
@@ -716,6 +718,7 @@ extern "C" {
enum ggml_object_type {
GGML_OBJECT_TYPE_TENSOR,
GGML_OBJECT_TYPE_GRAPH,
GGML_OBJECT_TYPE_EXTRA,
GGML_OBJECT_TYPE_WORK_BUFFER
};
@@ -1060,6 +1063,21 @@ extern "C" {
struct ggml_tensor * a,
struct ggml_tensor * b);
GGML_API struct ggml_tensor * ggml_add_reduce(
struct ggml_context * ctx,
struct ggml_tensor * a,
enum ggml_op op);
GGML_API struct ggml_tensor * ggml_reduce(
struct ggml_context * ctx,
struct ggml_tensor * a,
enum ggml_op op);
GGML_API struct ggml_tensor * ggml_reduce_inplace(
struct ggml_context * ctx,
struct ggml_tensor * a,
enum ggml_op op);
GGML_API struct ggml_tensor * ggml_add_cast(
struct ggml_context * ctx,
struct ggml_tensor * a,
@@ -3034,6 +3052,12 @@ extern "C" {
struct ggml_tensor ** splits;
} ggml_split_tensor_t;
GGML_API ggml_split_tensor_t * ggml_new_split(
struct ggml_context * ctx,
int n_device,
int split_dim,
struct ggml_tensor * tensor);
#ifdef __cplusplus
}
#endif