(self, x, emb)
| 169 | self.skip_connection = Conv2d(channels, out_channels, 1) if channels != out_channels else lambda x: x |
| 170 | |
| 171 | def __call__(self, x, emb): |
| 172 | h = x.sequential(self.in_layers) |
| 173 | emb_out = emb.sequential(self.emb_layers) |
| 174 | h = h + emb_out.reshape(*emb_out.shape, 1, 1) |
| 175 | h = h.sequential(self.out_layers) |
| 176 | ret = self.skip_connection(x) + h |
| 177 | return ret |
| 178 | |
| 179 | class CrossAttention: |
| 180 | def __init__(self, query_dim, context_dim, n_heads, d_head): |
nothing calls this directly
no outgoing calls
no test coverage detected