creates a copy of the tensor with the same memory layout
| 736 | |
| 737 | // creates a copy of the tensor with the same memory layout |
| 738 | static 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 | |
| 746 | static 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; |
no test coverage detected