MCPcopy
hub / github.com/openai/guided-diffusion / TimestepEmbedSequential

Class TimestepEmbedSequential

guided_diffusion/unet.py:66–78  ·  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

64
65
66class TimestepEmbedSequential(nn.Sequential, TimestepBlock):
67 """
68 A sequential module that passes timestep embeddings to the children that
69 support it as an extra input.
70 """
71
72 def forward(self, x, emb):
73 for layer in self:
74 if isinstance(layer, TimestepBlock):
75 x = layer(x, emb)
76 else:
77 x = layer(x)
78 return x
79
80
81class Upsample(nn.Module):

Callers 2

__init__Method · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected