MCPcopy Create free account
hub / github.com/YesianRohn/TextSSR / setup

Method setup

diffusers/src/diffusers/models/vae_flax.py:223–230  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

221 dtype: jnp.dtype = jnp.float32
222
223 def setup(self):
224 self.num_heads = self.channels // self.num_head_channels if self.num_head_channels is not None else 1
225
226 dense = partial(nn.Dense, self.channels, dtype=self.dtype)
227
228 self.group_norm = nn.GroupNorm(num_groups=self.num_groups, epsilon=1e-6)
229 self.query, self.key, self.value = dense(), dense(), dense()
230 self.proj_attn = dense()
231
232 def transpose_for_scores(self, projection):
233 new_projection_shape = projection.shape[:-1] + (self.num_heads, -1)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected