(self)
| 156 | ) |
| 157 | |
| 158 | def _create_layer_parameter_specs(self) -> dict[str, ParameterSpec]: |
| 159 | cfg = self.config |
| 160 | return dict( |
| 161 | # Output layer weights are shared with encoder, but bias is a separate parameter. |
| 162 | output_bias=ParameterSpec( |
| 163 | shape=[cfg.num_classes], |
| 164 | mesh_axes=(None,), |
| 165 | initializer=constant_initializer(0.0), |
| 166 | ), |
| 167 | ) |
| 168 | |
| 169 | def forward(self, input_batch: NestedTensor) -> Tensor: |
| 170 | """Produces prediction scores from BERT output features. |
nothing calls this directly
no test coverage detected