MCPcopy Index your code
hub / github.com/openai/improved-diffusion / TimestepEmbedSequential

Class TimestepEmbedSequential

improved_diffusion/unet.py:35–47  ·  view source on GitHub ↗

A sequential module that passes timestep embeddings to the children that support it as an extra input.

Source from the content-addressed store, hash-verified

33
34
35class TimestepEmbedSequential(nn.Sequential, TimestepBlock):
36 """
37 A sequential module that passes timestep embeddings to the children that
38 support it as an extra input.
39 """
40
41 def forward(self, x, emb):
42 for layer in self:
43 if isinstance(layer, TimestepBlock):
44 x = layer(x, emb)
45 else:
46 x = layer(x)
47 return x
48
49
50class Upsample(nn.Module):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected