MCPcopy Create free account
hub / github.com/ml-explore/mlx-examples / upsample_nearest

Function upsample_nearest

stable_diffusion/stable_diffusion/unet.py:12–17  ·  view source on GitHub ↗
(x, scale: int = 2)

Source from the content-addressed store, hash-verified

10
11
12def upsample_nearest(x, scale: int = 2):
13 B, H, W, C = x.shape
14 x = mx.broadcast_to(x[:, :, None, :, None, :], (B, H, scale, W, scale, C))
15 x = x.reshape(B, H * scale, W * scale, C)
16
17 return x
18
19
20class TimestepEmbedding(nn.Module):

Callers 2

__call__Method · 0.70
__call__Method · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected