MCPcopy Create free account
hub / github.com/AMAP-ML/Eevee / unpatchify

Function unpatchify

models/vae.py:214–224  ·  view source on GitHub ↗
(x, patch_size)

Source from the content-addressed store, hash-verified

212
213
214def unpatchify(x, patch_size):
215 if patch_size == 1:
216 return x
217 if x.dim() == 4:
218 x = rearrange(x, "b (c r q) h w -> b c (h q) (w r)", q=patch_size, r=patch_size)
219 elif x.dim() == 5:
220 x = rearrange(x,
221 "b (c r q) f h w -> b c f (h q) (w r)",
222 q=patch_size,
223 r=patch_size)
224 return x
225
226
227class Resample38(Resample):

Callers 1

decodeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected