MCPcopy Create free account
hub / github.com/LTH14/rcg / forward

Method forward

pixel_generator/guided_diffusion/unet.py:224–234  ·  view source on GitHub ↗

Apply the block to a Tensor, conditioned on a timestep embedding. :param x: an [N x C x ...] Tensor of features. :param emb: an [N x emb_channels] Tensor of timestep embeddings. :return: an [N x C x ...] Tensor of outputs.

(self, x, emb)

Source from the content-addressed store, hash-verified

222 self.skip_connection = conv_nd(dims, channels, self.out_channels, 1)
223
224 def forward(self, x, emb):
225 """
226 Apply the block to a Tensor, conditioned on a timestep embedding.
227
228 :param x: an [N x C x ...] Tensor of features.
229 :param emb: an [N x emb_channels] Tensor of timestep embeddings.
230 :return: an [N x C x ...] Tensor of outputs.
231 """
232 return checkpoint(
233 self._forward, (x, emb), self.parameters(), self.use_checkpoint
234 )
235
236 def _forward(self, x, emb):
237 if self.updown:

Callers

nothing calls this directly

Calls 1

checkpointFunction · 0.90

Tested by

no test coverage detected