MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / ggml_dup_tensor_layout

Function ggml_dup_tensor_layout

ggml-backend.c:571–577  ·  view source on GitHub ↗

creates a copy of the tensor with the same memory layout

Source from the content-addressed store, hash-verified

569
570// creates a copy of the tensor with the same memory layout
571static struct ggml_tensor * ggml_dup_tensor_layout(struct ggml_context * ctx, const struct ggml_tensor * tensor) {
572 struct ggml_tensor * dup = ggml_dup_tensor(ctx, tensor);
573 for (int i = 0; i < GGML_MAX_DIMS; i++) {
574 dup->nb[i] = tensor->nb[i];
575 }
576 return dup;
577}
578
579// assigns backends to ops and splits the graph into subgraphs that can be computed on the same backend
580// TODO: merge passes

Callers 1

sched_split_graphFunction · 0.70

Calls 1

ggml_dup_tensorFunction · 0.70

Tested by

no test coverage detected