MCPcopy Create free account
hub / github.com/AMAP-ML/EMF / post_process

Method post_process

tok/mm_autoencoder.py:31–35  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

29 return x
30
31 def post_process(self, x):
32 x = x.cpu().float().clamp(0., 1.) * 255.
33 x = x.permute(0, 2, 3, 1) # [b, h, w, c]
34 x = x.to(torch.uint8)
35 return x
36
37 def encode(self, x):
38 return self.encoder(x.to(self.encoder.dtype))['encoded']

Callers 3

forwardMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected