MCPcopy Create free account
hub / github.com/CompVis/diff2flow / encode

Method encode

diff2flow/tiny_autoencoder.py:66–73  ·  view source on GitHub ↗

Args: x: torch.Tensor, shape (b, 3, h, w) in [-1, 1]

(self, x)

Source from the content-addressed store, hash-verified

64
65 @torch.no_grad()
66 def encode(self, x):
67 """
68 Args:
69 x: torch.Tensor, shape (b, 3, h, w) in [-1, 1]
70 """
71 # scale to [0, 1]
72 x = x.div(2).add(0.5)
73 return self.encoder(x)
74
75 @torch.no_grad()
76 def decode(self, z):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected