MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / ggml_dup_tensor_layout

Function ggml_dup_tensor_layout

external/ggml/src/ggml-backend.cpp:738–744  ·  view source on GitHub ↗

creates a copy of the tensor with the same memory layout

Source from the content-addressed store, hash-verified

736
737// creates a copy of the tensor with the same memory layout
738static struct ggml_tensor * ggml_dup_tensor_layout(struct ggml_context * ctx, const struct ggml_tensor * tensor) {
739 struct ggml_tensor * dup = ggml_dup_tensor(ctx, tensor);
740 for (int i = 0; i < GGML_MAX_DIMS; i++) {
741 dup->nb[i] = tensor->nb[i];
742 }
743 return dup;
744}
745
746static bool ggml_is_view_op(enum ggml_op op) {
747 return op == GGML_OP_VIEW || op == GGML_OP_RESHAPE || op == GGML_OP_PERMUTE || op == GGML_OP_TRANSPOSE;

Callers 2

graph_copy_dup_tensorFunction · 0.85

Calls 1

ggml_dup_tensorFunction · 0.85

Tested by

no test coverage detected