MCPcopy Create free account
hub / github.com/OpenDriveLab/ReSim / forward

Method forward

sat/sgm/modules/diffusionmodules/openaimodel.py:311–318  ·  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

309 self.skip_connection = conv_nd(dims, channels, self.out_channels, 1)
310
311 def forward(self, x, emb):
312 """
313 Apply the block to a Tensor, conditioned on a timestep embedding.
314 :param x: an [N x C x ...] Tensor of features.
315 :param emb: an [N x emb_channels] Tensor of timestep embeddings.
316 :return: an [N x C x ...] Tensor of outputs.
317 """
318 return checkpoint(self._forward, (x, emb), self.parameters(), self.use_checkpoint)
319
320 def _forward(self, x, emb):
321 if self.updown:

Callers

nothing calls this directly

Calls 2

parametersMethod · 0.80
checkpointFunction · 0.70

Tested by

no test coverage detected