提交 36dc2788 authored 作者: George Ho's avatar George Ho

flake8 fixes

上级 24f0bdb0
import os import os
from pickle import Unpickler
import numpy as np import numpy as np
import pytest import pytest
...@@ -372,8 +371,3 @@ def test_gpu_opt_wor(): ...@@ -372,8 +371,3 @@ def test_gpu_opt_wor():
pval = pval / pval.sum(axis=1)[:, None] pval = pval / pval.sum(axis=1)[:, None]
uval = np.ones_like(pval[:, 0]) * 0.5 uval = np.ones_like(pval[:, 0]) * 0.5
f(pval, uval, 1) f(pval, uval, 1)
def test_unpickle_legacy_op():
testfile_dir = os.path.dirname(os.path.realpath(__file__))
fname = "test_gpuarray_multinomial_wo_replacement.pkl"
...@@ -1941,7 +1941,7 @@ class Compiler: ...@@ -1941,7 +1941,7 @@ class Compiler:
if not compiler: if not compiler:
return False return False
code = b( code = (
""" """
%(preambule)s %(preambule)s
int main(int argc, char** argv) int main(int argc, char** argv)
...@@ -1951,7 +1951,7 @@ class Compiler: ...@@ -1951,7 +1951,7 @@ class Compiler:
} }
""" """
% locals() % locals()
) ).encode()
return cls._try_compile_tmp( return cls._try_compile_tmp(
code, code,
tmp_prefix="try_flags_", tmp_prefix="try_flags_",
......
import hashlib
import linecache import linecache
import sys import sys
import traceback import traceback
from io import StringIO from io import StringIO
import numpy as np
from theano import config from theano import config
...@@ -597,9 +596,6 @@ def remove(predicate, coll): ...@@ -597,9 +596,6 @@ def remove(predicate, coll):
return [x for x in coll if not predicate(x)] return [x for x in coll if not predicate(x)]
import hashlib
def hash_from_code(msg): def hash_from_code(msg):
# hashlib.sha256() requires an object that supports buffer interface, # hashlib.sha256() requires an object that supports buffer interface,
# but Python 3 (unicode) strings don't. # but Python 3 (unicode) strings don't.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论