| 4912 | // ggml_upscale / ggml_interpolate |
| 4913 | |
| 4914 | static struct ggml_tensor * ggml_interpolate_impl( |
| 4915 | struct ggml_context * ctx, |
| 4916 | struct ggml_tensor * a, |
| 4917 | int64_t ne0, |
| 4918 | int64_t ne1, |
| 4919 | int64_t ne2, |
| 4920 | int64_t ne3, |
| 4921 | uint32_t mode) { |
| 4922 | GGML_ASSERT((mode & 0xFF) < GGML_SCALE_MODE_COUNT); |
| 4923 | // TODO: implement antialias for modes other than bilinear |
| 4924 | GGML_ASSERT(!(mode & GGML_SCALE_FLAG_ANTIALIAS) || (mode & 0xFF) == GGML_SCALE_MODE_BILINEAR); |
| 4925 | |
| 4926 | struct ggml_tensor * result = ggml_new_tensor_4d(ctx, a->type, ne0, ne1, ne2, ne3); |
| 4927 | |
| 4928 | ggml_set_op_params_i32(result, 0, (int32_t)mode); |
| 4929 | |
| 4930 | result->op = GGML_OP_UPSCALE; |
| 4931 | result->src[0] = a; |
| 4932 | |
| 4933 | return result; |
| 4934 | } |
| 4935 | |
| 4936 | struct ggml_tensor * ggml_upscale( |
| 4937 | struct ggml_context * ctx, |
no test coverage detected