瀏覽代碼

Undefined names: import random, torch

[flake8](http://flake8.pycqa.org) testing of https://github.com/jantic/DeOldify on Python 3.7.1

$ __flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics__
```
./fastai/models/cifar10/utils.py:114:32: F821 undefined name 'random'
  return string + '-{}'.format(random.randint(1, 10000))
                               ^
./fastai/models/cifar10/utils_kuangliu.py:17:18: F821 undefined name 'torch'
    dataloader = torch.utils.data.DataLoader(dataset, batch_size=1, shuffle=True, num_workers=2)
                 ^
./fastai/models/cifar10/utils_kuangliu.py:18:12: F821 undefined name 'torch'
    mean = torch.zeros(3)
           ^
./fastai/models/cifar10/utils_kuangliu.py:19:11: F821 undefined name 'torch'
    std = torch.zeros(3)
          ^
4     F821 undefined name 'random'
4
```
cclauss 6 年之前
父節點
當前提交
5d205783cf
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      fastai/models/cifar10/utils.py

+ 2 - 0
fastai/models/cifar10/utils.py

@@ -1,4 +1,6 @@
 import os, sys, time
+import random
+import torch
 import numpy as np
 import matplotlib
 matplotlib.use('agg')