(self, x:TensorType)
| 211 | |
| 212 | |
| 213 | def forward(self, x:TensorType) -> TensorType: |
| 214 | attn_mask = (x != self.config.pad_token_id).long() |
| 215 | out = self.transformer(input_ids=x, attention_mask=attn_mask) |
| 216 | pooled_out = self.pooler(out, attn_mask) |
| 217 | |
| 218 | return self.proj(pooled_out) |
| 219 | |
| 220 | def lock(self, unlocked_layers:int=0, freeze_layer_norm:bool=True): |
| 221 | if not unlocked_layers: # full freezing |
nothing calls this directly
no outgoing calls
no test coverage detected