Commit 2f174642 authored by Julien Chaumond's avatar Julien Chaumond
Browse files

[common attributes] Slightly sharper test coverage

parent 9d2398fd
......@@ -468,9 +468,15 @@ class CommonTestCases:
for model_class in self.all_model_classes:
model = model_class(config)
model.get_input_embeddings()
self.assertIsInstance(
model.get_input_embeddings(),
torch.nn.Embedding
)
model.set_input_embeddings(torch.nn.Embedding(10, 10))
model.get_output_embeddings()
x = model.get_output_embeddings()
self.assertTrue(
x is None or isinstance(x, torch.nn.Linear)
)
def test_tie_model_weights(self):
if not self.test_torchscript:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment