MCPcopy Create free account
hub / github.com/SooLab/CGFormer / set_input_embeddings

Method set_input_embeddings

bert/modeling_utils.py:324–336  ·  view source on GitHub ↗

Set model's input embeddings Args: value (:obj:`nn.Module`): A module mapping vocabulary to hidden states.

(self, value: nn.Module)

Source from the content-addressed store, hash-verified

322 raise NotImplementedError
323
324 def set_input_embeddings(self, value: nn.Module):
325 """
326 Set model's input embeddings
327
328 Args:
329 value (:obj:`nn.Module`):
330 A module mapping vocabulary to hidden states.
331 """
332 base_model = getattr(self, self.base_model_prefix, self)
333 if base_model is not self:
334 base_model.set_input_embeddings(value)
335 else:
336 raise NotImplementedError
337
338 def get_output_embeddings(self):
339 """

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected