Skip to content

Commit a0252fa

Browse files
AclyMinh141120
authored andcommitted
ggml-cpu : "align corners" for bilinear upscale/downscale (ggml/1285)
* add "align corners" mode for bilinear upscale, and allow downscaling * add ggml_interpolate, deprecate ggml_upscale_ext, pass in align-corners as bit-flag * test-backend-ops: replace ggml_upscale_ext with ggml_interpolate, add test cases for downscale and align-corners
1 parent bdb1f3d commit a0252fa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ggml/src/ggml.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4465,6 +4465,7 @@ struct ggml_tensor * ggml_pool_2d_back(
44654465

44664466
// ggml_upscale / ggml_interpolate
44674467

4468+
static struct ggml_tensor * ggml_interpolate_impl(
44684469
static struct ggml_tensor * ggml_interpolate_impl(
44694470
struct ggml_context * ctx,
44704471
struct ggml_tensor * a,
@@ -4474,7 +4475,7 @@ static struct ggml_tensor * ggml_interpolate_impl(
44744475
int64_t ne3,
44754476
uint32_t mode) {
44764477
GGML_ASSERT((mode & 0xFF) < GGML_SCALE_MODE_COUNT);
4477-
4478+
44784479
struct ggml_tensor * result = ggml_new_tensor_4d(ctx, a->type, ne0, ne1, ne2, ne3);
44794480

44804481
ggml_set_op_params_i32(result, 0, (int32_t)mode);

0 commit comments

Comments
 (0)