@@ -1946,28 +1946,11 @@ def check_same_values(layer_1, layer_2):
1946
1946
# Check that the embedding layer and decoding layer are the same in size and in value
1947
1947
# self.assertTrue(check_same_values(embeddings, decoding))
1948
1948
1949
- # # Check that after modification, they remain the same.
1950
- # embeddings.weight.data.div_(2)
1951
- # # Check that the embedding layer and decoding layer are the same in size and in value
1952
- # self.assertTrue(embeddings.weight.shape, decoding.weight.shape)
1953
- # self.assertTrue(check_same_values(embeddings, decoding))
1954
-
1955
- # # Check that after modification, they remain the same.
1956
- # decoding.weight.data.div_(4)
1957
- # # Check that the embedding layer and decoding layer are the same in size and in value
1958
- # self.assertTrue(embeddings.weight.shape, decoding.weight.shape)
1959
- # self.assertTrue(check_same_values(embeddings, decoding))
1960
-
1961
1949
# Check that after resize they remain tied.
1962
1950
model_tied .resize_token_embeddings (config .vocab_size + 10 )
1963
1951
params_tied_2 = list (model_tied .parameters ())
1964
1952
self .assertEqual (len (params_tied_2 ), len (params_tied ))
1965
1953
1966
- # decoding.weight.data.mul_(20)
1967
- # # Check that the embedding layer and decoding layer are the same in size and in value
1968
- # self.assertTrue(model.transformer.wte.weight.shape, model.lm_head.weight.shape)
1969
- # self.assertTrue(check_same_values(model.transformer.wte, model.lm_head))
1970
-
1971
1954
@require_safetensors
1972
1955
def test_can_use_safetensors (self ):
1973
1956
config , _ = self .model_tester .prepare_config_and_inputs_for_common ()
0 commit comments