"...gpu/git@developer.sourcefind.cn:gaoqiong/migraphx.git" did not exist on "70e63960f08484cfe4b6df7575522a7645d1bdaf"
Unverified Commit 2c177a87 authored by Thomas Wolf's avatar Thomas Wolf Committed by GitHub
Browse files

Merge pull request #1228 from huggingface/head-masking-test

Trying to fix the head masking test
parents a95ced62 58b59a0c
......@@ -163,8 +163,9 @@ class CommonTestCases:
if not self.test_head_masking:
return
torch.manual_seed(42)
global_rng.seed(42)
config, inputs_dict = self.model_tester.prepare_config_and_inputs_for_common()
global_rng.seed()
config.output_attentions = True
config.output_hidden_states = True
......@@ -665,12 +666,13 @@ class ConfigTester(object):
self.create_and_test_config_to_json_file()
global_rng = random.Random()
def ids_tensor(shape, vocab_size, rng=None, name=None):
"""Creates a random int32 tensor of the shape within the vocab size."""
if rng is None:
rng = random.Random()
rng = global_rng
total_dims = 1
for dim in shape:
......
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