mlx
mlx copied to clipboard
Upsample support
I would like to request the addition of native support for the Upsample operation in MLX. Currently, the absence of Upsample functionality limits the flexibility of certain tasks that require resizing or upsampling of data (like UNet definition).
In the meanwhile, does someone have alternative methods for emulating the upsample functionality?
Thank you!
See the upsample_nearest function the Stable Diffusion example:
def upsample_nearest(x, scale: int = 2):
B, H, W, C = x.shape
x = mx.broadcast_to(x[:, :, None, :, None, :], (B, H, scale, W, scale, C))
x = x.reshape(B, H * scale, W * scale, C)
return x
Thank you very much! If you do not plan to implement a standalone class, it is possible for me to close the issue.