提交 95222657 authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Use warnings module instead of sys.stderr

上级 7a9d92de
...@@ -5,7 +5,7 @@ Generator code in SSJ package (L'Ecuyer & Simard) ...@@ -5,7 +5,7 @@ Generator code in SSJ package (L'Ecuyer & Simard)
http://www.iro.umontreal.ca/~simardr/ssj/indexe.html http://www.iro.umontreal.ca/~simardr/ssj/indexe.html
""" """
import sys import sys, warnings
import numpy import numpy
from theano import Op, Apply, shared, config, Variable from theano import Op, Apply, shared, config, Variable
...@@ -622,13 +622,10 @@ def guess_n_streams(size, warn=True): ...@@ -622,13 +622,10 @@ def guess_n_streams(size, warn=True):
return r return r
else: else:
if warn: if warn:
# TODO We should use the logging (or warnings) module, not warnings.warn((
# sys.stderr.
# It's also easier to use those module to filter out that message
# in the tests.
print >> sys.stderr, (
"MRG_RandomStreams Can't determine #streams from " "MRG_RandomStreams Can't determine #streams from "
"size (%s), guessing 30*256") % str(size) "size (%s), guessing 30*256") % str(size),
stacklevel=3)
return 30 * 256 return 30 * 256
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论