(self)
| 289 | return f"dim={self.dim}, input_resolution={self.input_resolution}, depth={self.depth}" |
| 290 | |
| 291 | def flops(self): |
| 292 | flops = 0 |
| 293 | for blk in self.blocks: |
| 294 | flops += blk.flops() |
| 295 | if self.downsample is not None: |
| 296 | flops += self.downsample.flops() |
| 297 | return flops |
| 298 | |
| 299 | |
| 300 | class PatchEmbed(nn.Module): |