Skip to content

Commit b2f2637

Browse files
committed
Fix test to avoid randomness
Signed-off-by: Chang Liu (Enterprise Products) <[email protected]>
1 parent 7155b28 commit b2f2637

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tests/unittest/_torch/multimodal/test_fuse_input_embeds.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
def make_embedding(num_embeddings: int = 100,
1010
hidden_size: int = 16,
1111
device: str = "cpu") -> Embedding:
12+
torch.manual_seed(0)
1213
emb = Embedding(num_embeddings=num_embeddings, embedding_dim=hidden_size)
14+
emb.weight.data.normal_(mean=0.0, std=0.02)
1315
return emb.to(device)
1416

1517

0 commit comments

Comments
 (0)