(self, x, **kwargs)
| 140 | self.amp_dtype = amp_dtype |
| 141 | |
| 142 | def forward(self, x, **kwargs): |
| 143 | with torch.autocast("cuda", enabled=self.amp, dtype = self.amp_dtype): |
| 144 | feats = {} |
| 145 | scale = 1 |
| 146 | for layer in self.layers: |
| 147 | if isinstance(layer, nn.MaxPool2d): |
| 148 | feats[scale] = x |
| 149 | scale = scale*2 |
| 150 | x = layer(x) |
| 151 | return feats |
| 152 | |
| 153 | class CNNandDinov2(nn.Module): |
| 154 | def __init__(self, cnn_kwargs = None, amp = True, amp_dtype = torch.float16): |
nothing calls this directly
no outgoing calls
no test coverage detected