mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2025-09-02 21:28:38 -04:00
ggml : add ggml_cont() + optimize ggml_cpy() for contiguous dst
This commit is contained in:
6
ggml.h
6
ggml.h
@@ -236,6 +236,7 @@ enum ggml_op {
|
||||
|
||||
GGML_OP_SCALE,
|
||||
GGML_OP_CPY,
|
||||
GGML_OP_CONT,
|
||||
GGML_OP_RESHAPE,
|
||||
GGML_OP_VIEW,
|
||||
GGML_OP_PERMUTE,
|
||||
@@ -525,6 +526,11 @@ struct ggml_tensor * ggml_cpy(
|
||||
struct ggml_tensor * a,
|
||||
struct ggml_tensor * b);
|
||||
|
||||
// make contiguous
|
||||
struct ggml_tensor * ggml_cont(
|
||||
struct ggml_context * ctx,
|
||||
struct ggml_tensor * a);
|
||||
|
||||
// return view(a), b specifies the new shape
|
||||
// TODO: when we start computing gradient, make a copy instead of view
|
||||
struct ggml_tensor * ggml_reshape(
|
||||
|
Reference in New Issue
Block a user