(self, hidden_states, timestep, prompt_emb, pooled_prompt_emb, tile_size=128, tile_stride=64)
| 337 | self.proj_out = torch.nn.Linear(embed_dim, 64) |
| 338 | |
| 339 | def tiled_forward(self, hidden_states, timestep, prompt_emb, pooled_prompt_emb, tile_size=128, tile_stride=64): |
| 340 | # Due to the global positional embedding, we cannot implement layer-wise tiled forward. |
| 341 | hidden_states = TileWorker().tiled_forward( |
| 342 | lambda x: self.forward(x, timestep, prompt_emb, pooled_prompt_emb), |
| 343 | hidden_states, |
| 344 | tile_size, |
| 345 | tile_stride, |
| 346 | tile_device=hidden_states.device, |
| 347 | tile_dtype=hidden_states.dtype |
| 348 | ) |
| 349 | return hidden_states |
| 350 | |
| 351 | def forward(self, hidden_states, timestep, prompt_emb, pooled_prompt_emb, tiled=False, tile_size=128, tile_stride=64, use_gradient_checkpointing=False): |
| 352 | if tiled: |
no test coverage detected