MCPcopy Index your code
hub / github.com/VisionXLab/OF-Diff / TimestepEmbedSequential

Class TimestepEmbedSequential

ldm/modules/diffusionmodules/openaimodel.py:76–90  ·  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

74
75
76class TimestepEmbedSequential(nn.Sequential, TimestepBlock):
77 """
78 A sequential module that passes timestep embeddings to the children that
79 support it as an extra input.
80 """
81
82 def forward(self, x, emb, context=None):
83 for layer in self:
84 if isinstance(layer, TimestepBlock):
85 x = layer(x, emb)
86 elif isinstance(layer, SpatialTransformer):
87 x = layer(x, context)
88 else:
89 x = layer(x)
90 return x
91
92class Upsample(nn.Module):
93 """

Callers 3

__init__Method · 0.90
make_zero_convMethod · 0.90
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected