Unverified Commit 776c9d3a authored by NielsRogge's avatar NielsRogge Committed by GitHub
Browse files

[Tests] Remove unused code (#29737)

Remove unused code
parent a1a74541
...@@ -1946,28 +1946,11 @@ class ModelTesterMixin: ...@@ -1946,28 +1946,11 @@ class ModelTesterMixin:
# Check that the embedding layer and decoding layer are the same in size and in value # Check that the embedding layer and decoding layer are the same in size and in value
# self.assertTrue(check_same_values(embeddings, decoding)) # self.assertTrue(check_same_values(embeddings, decoding))
# # Check that after modification, they remain the same.
# embeddings.weight.data.div_(2)
# # Check that the embedding layer and decoding layer are the same in size and in value
# self.assertTrue(embeddings.weight.shape, decoding.weight.shape)
# self.assertTrue(check_same_values(embeddings, decoding))
# # Check that after modification, they remain the same.
# decoding.weight.data.div_(4)
# # Check that the embedding layer and decoding layer are the same in size and in value
# self.assertTrue(embeddings.weight.shape, decoding.weight.shape)
# self.assertTrue(check_same_values(embeddings, decoding))
# Check that after resize they remain tied. # Check that after resize they remain tied.
model_tied.resize_token_embeddings(config.vocab_size + 10) model_tied.resize_token_embeddings(config.vocab_size + 10)
params_tied_2 = list(model_tied.parameters()) params_tied_2 = list(model_tied.parameters())
self.assertEqual(len(params_tied_2), len(params_tied)) self.assertEqual(len(params_tied_2), len(params_tied))
# decoding.weight.data.mul_(20)
# # Check that the embedding layer and decoding layer are the same in size and in value
# self.assertTrue(model.transformer.wte.weight.shape, model.lm_head.weight.shape)
# self.assertTrue(check_same_values(model.transformer.wte, model.lm_head))
@require_safetensors @require_safetensors
def test_can_use_safetensors(self): def test_can_use_safetensors(self):
config, _ = self.model_tester.prepare_config_and_inputs_for_common() config, _ = self.model_tester.prepare_config_and_inputs_for_common()
......
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