Skip to content

Commit 808a9b1

Browse files
committed
zqi: 2-3 modify model.py
1 parent 824d88e commit 808a9b1

File tree

1 file changed

+5
-0
lines changed
  • samples/python/network_api_pytorch_mnist

1 file changed

+5
-0
lines changed

samples/python/network_api_pytorch_mnist/model.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@
2626
import numpy as np
2727

2828
from random import randint
29+
import random
2930

31+
seed = 42
32+
torch.manual_seed(seed)
33+
np.random.seed(seed)
34+
random.seed(seed)
3035

3136
# Network
3237
class Net(nn.Module):

0 commit comments

Comments
 (0)