creates a copy of the tensor with the same memory layout
| 569 | |
| 570 | // creates a copy of the tensor with the same memory layout |
| 571 | static 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 |
no test coverage detected