提交 8134ccce authored 作者: David Warde-Farley's avatar David Warde-Farley

Trailing whitespace removal.

上级 01a99d79
...@@ -81,7 +81,7 @@ def main(): ...@@ -81,7 +81,7 @@ def main():
time_prof_args = [arg for arg in sys.argv if arg=='--time-profile'] time_prof_args = [arg for arg in sys.argv if arg=='--time-profile']
for arg in time_prof_args: for arg in time_prof_args:
sys.argv.remove(arg) sys.argv.remove(arg)
# Time-profiling and batch modes # Time-profiling and batch modes
if time_prof_args or batch_args: if time_prof_args or batch_args:
from theano.tests import run_tests_in_batch from theano.tests import run_tests_in_batch
...@@ -156,7 +156,7 @@ def help(): ...@@ -156,7 +156,7 @@ def help():
progresses will be made to standard output after every group of progresses will be made to standard output after every group of
n tests. Otherwise, notification will occur after every group n tests. Otherwise, notification will occur after every group
of 100 tests. of 100 tests.
The files 'timeprof_sort' and 'timeprof_nosort' both contain one The files 'timeprof_sort' and 'timeprof_nosort' both contain one
record for each test and comprise the following fields: record for each test and comprise the following fields:
- test running-time - test running-time
...@@ -166,7 +166,7 @@ def help(): ...@@ -166,7 +166,7 @@ def help():
information is contained in test name information is contained in test name
- test outcome ('OK', 'SKIPPED TEST', 'FAILED TEST' or - test outcome ('OK', 'SKIPPED TEST', 'FAILED TEST' or
'FAILED PARSING') 'FAILED PARSING')
In 'timeprof_sort', test records are sorted according to In 'timeprof_sort', test records are sorted according to
running-time whereas in 'timeprof_nosort' records are reported running-time whereas in 'timeprof_nosort' records are reported
according to sequential number. The former classification is the according to sequential number. The former classification is the
...@@ -174,7 +174,7 @@ def help(): ...@@ -174,7 +174,7 @@ def help():
to same or close classes and files have close sequential, the to same or close classes and files have close sequential, the
latter may be used to identify duration patterns among the tests latter may be used to identify duration patterns among the tests
numbers. A full log is also saved as 'timeprof_rawlog'. numbers. A full log is also saved as 'timeprof_rawlog'.
--without-knownfailure: Do not load the KnownFailure plugin. --without-knownfailure: Do not load the KnownFailure plugin.
--theano: This parameter is replaced with the path to the theano --theano: This parameter is replaced with the path to the theano
...@@ -198,12 +198,12 @@ def help(): ...@@ -198,12 +198,12 @@ def help():
class DisabDocString(Plugin): class DisabDocString(Plugin):
""" """
When activated, a custom Nosetests plugin created through this class When activated, a custom Nosetests plugin created through this class
will preclude automatic replacement in display of the name of the test will preclude automatic replacement in display of the name of the test
by the first line in its documentation string. by the first line in its documentation string.
Sources: Sources:
http://nose.readthedocs.org/en/latest/developing.html http://nose.readthedocs.org/en/latest/developing.html
http://nose.readthedocs.org/en/latest/further_reading.html http://nose.readthedocs.org/en/latest/further_reading.html
...@@ -214,10 +214,10 @@ class DisabDocString(Plugin): ...@@ -214,10 +214,10 @@ class DisabDocString(Plugin):
https://github.com/Merino/nose-description-fixer-plugin/commit/ https://github.com/Merino/nose-description-fixer-plugin/commit/
df94596f29c04fea8001713dd9b04bf3720aebf4 df94596f29c04fea8001713dd9b04bf3720aebf4
""" """
enabled = False # plugin disabled by default enabled = False # plugin disabled by default
score = 2000 # high score ensures priority over other plugins score = 2000 # high score ensures priority over other plugins
def __init__(self): def __init__(self):
# 'super.__init__(self):' would have achieved exactly the same # 'super.__init__(self):' would have achieved exactly the same
if self.name is None: if self.name is None:
...@@ -253,7 +253,7 @@ class DisabDocString(Plugin): ...@@ -253,7 +253,7 @@ class DisabDocString(Plugin):
# 'describeTest' is also called when the test result in Nosetests calls # 'describeTest' is also called when the test result in Nosetests calls
# 'test.shortDescription()' and can thus be used to alter the display. # 'test.shortDescription()' and can thus be used to alter the display.
return False return False
if __name__ == '__main__': if __name__ == '__main__':
if '--help' in sys.argv or '-h' in sys.argv: if '--help' in sys.argv or '-h' in sys.argv:
help() help()
......
...@@ -709,7 +709,7 @@ class ProfileStats(object): ...@@ -709,7 +709,7 @@ class ProfileStats(object):
def count_running_memory(order, fgraph, nodes_mem): def count_running_memory(order, fgraph, nodes_mem):
""" """
Calculate memory with specific node order Calculate memory with specific node order
Return a list including the following values Return a list including the following values
1. node_memory_size 1. node_memory_size
Sum of the size of all variables that actually allocate Sum of the size of all variables that actually allocate
...@@ -717,10 +717,10 @@ class ProfileStats(object): ...@@ -717,10 +717,10 @@ class ProfileStats(object):
2. running_memory_size 2. running_memory_size
The memory allocated after the current apply node The memory allocated after the current apply node
3. running_max_memory_size 3. running_max_memory_size
The maximum of running_memory_size during the function The maximum of running_memory_size during the function
4. node_memory_saved_by_view 4. node_memory_saved_by_view
The sum of memory saved by returning view instead of new The sum of memory saved by returning view instead of new
allocation allocation
5. node_memory_saved_by_inplace 5. node_memory_saved_by_inplace
The sum of memory saved by reusing the input instead of The sum of memory saved by reusing the input instead of
new allocation new allocation
......
...@@ -653,7 +653,7 @@ class TestConv2DGPU(unittest.TestCase): ...@@ -653,7 +653,7 @@ class TestConv2DGPU(unittest.TestCase):
class TestConvWithPadding(object): class TestConvWithPadding(object):
"""test conv ops that support arbitrary padding via border_mode """test conv ops that support arbitrary padding via border_mode
note that in order to make the yield work, we can not subclass from note that in order to make the yield work, we can not subclass from
unittest.TestCase unittest.TestCase
""" """
......
...@@ -638,7 +638,7 @@ def poisson(random_state, size=None, lam=1.0, ndim=None, dtype='int64'): ...@@ -638,7 +638,7 @@ def poisson(random_state, size=None, lam=1.0, ndim=None, dtype='int64'):
Draw samples from a Poisson distribution. Draw samples from a Poisson distribution.
The Poisson distribution is the limit of the Binomial distribution for large N. The Poisson distribution is the limit of the Binomial distribution for large N.
:param lam: float or ndarray-like of the same shape as size parameter :param lam: float or ndarray-like of the same shape as size parameter
Expectation of interval, should be >= 0. Expectation of interval, should be >= 0.
...@@ -650,7 +650,7 @@ def poisson(random_state, size=None, lam=1.0, ndim=None, dtype='int64'): ...@@ -650,7 +650,7 @@ def poisson(random_state, size=None, lam=1.0, ndim=None, dtype='int64'):
size or ndim must be given size or ndim must be given
""" """
lam = tensor.as_tensor_variable(lam) lam = tensor.as_tensor_variable(lam)
ndim, size, bcast = _infer_ndim_bcast(ndim, size) ndim, size, bcast = _infer_ndim_bcast(ndim, size)
op = RandomFunction("poisson", tensor.TensorType(dtype=dtype, op = RandomFunction("poisson", tensor.TensorType(dtype=dtype,
...@@ -926,7 +926,7 @@ class RandomStreamsBase(object): ...@@ -926,7 +926,7 @@ class RandomStreamsBase(object):
""" """
return self.gen(random_integers, size, low, high, ndim=ndim, return self.gen(random_integers, size, low, high, ndim=ndim,
dtype=dtype) dtype=dtype)
def choice(self, size=None, a=2, replace=True, p=None, ndim=None, def choice(self, size=None, a=2, replace=True, p=None, ndim=None,
dtype='int64'): dtype='int64'):
""" """
...@@ -943,7 +943,7 @@ class RandomStreamsBase(object): ...@@ -943,7 +943,7 @@ class RandomStreamsBase(object):
def poisson(self, size=None, lam=None, ndim=None, dtype='int64'): def poisson(self, size=None, lam=None, ndim=None, dtype='int64'):
""" """
Draw samples from a Poisson distribution. Draw samples from a Poisson distribution.
The Poisson distribution is the limit of the Binomial distribution for large N. The Poisson distribution is the limit of the Binomial distribution for large N.
If the size argument is ambiguous on the number of dimensions, If the size argument is ambiguous on the number of dimensions,
......
...@@ -22,9 +22,9 @@ def max_pool2D(*args, **kwargs): ...@@ -22,9 +22,9 @@ def max_pool2D(*args, **kwargs):
def max_pool_2d_same_size(input, patch_size): def max_pool_2d_same_size(input, patch_size):
""" """
Takes as input a 4-D tensor. It sets all non maximum values Takes as input a 4-D tensor. It sets all non maximum values
of non-overlapping patches of size (patch_size[0],patch_size[1]) to zero, of non-overlapping patches of size (patch_size[0],patch_size[1]) to zero,
keeping only the maximum values. The output has the same dimensions as keeping only the maximum values. The output has the same dimensions as
the input. the input.
:type input: 4-D theano tensor of input images. :type input: 4-D theano tensor of input images.
...@@ -348,7 +348,7 @@ class DownsampleFactorMax(Op): ...@@ -348,7 +348,7 @@ class DownsampleFactorMax(Op):
} }
if (%(ignore_border)s) if (%(ignore_border)s)
{ {
// '/' in C is different from '/' in python // '/' in C is different from '/' in python
if (r - %(ds0)s < 0) if (r - %(ds0)s < 0)
{ {
......
...@@ -173,11 +173,11 @@ def test_debugprint(): ...@@ -173,11 +173,11 @@ def test_debugprint():
debugprint(G, file=s, ids='int') debugprint(G, file=s, ids='int')
s = s.getvalue() s = s.getvalue()
# The additional white space are needed! # The additional white space are needed!
reference = """Elemwise{add,no_inplace} [@0] '' reference = """Elemwise{add,no_inplace} [@0] ''
|Elemwise{add,no_inplace} [@1] 'C' |Elemwise{add,no_inplace} [@1] 'C'
| |A [@2] | |A [@2]
| |B [@3] | |B [@3]
|Elemwise{add,no_inplace} [@4] '' |Elemwise{add,no_inplace} [@4] ''
|D [@5] |D [@5]
|E [@6] |E [@6]
""" """
...@@ -193,11 +193,11 @@ def test_debugprint(): ...@@ -193,11 +193,11 @@ def test_debugprint():
debugprint(G, file=s, ids='CHAR') debugprint(G, file=s, ids='CHAR')
s = s.getvalue() s = s.getvalue()
# The additional white space are needed! # The additional white space are needed!
reference = """Elemwise{add,no_inplace} [@A] '' reference = """Elemwise{add,no_inplace} [@A] ''
|Elemwise{add,no_inplace} [@B] 'C' |Elemwise{add,no_inplace} [@B] 'C'
| |A [@C] | |A [@C]
| |B [@D] | |B [@D]
|Elemwise{add,no_inplace} [@E] '' |Elemwise{add,no_inplace} [@E] ''
|D [@F] |D [@F]
|E [@G] |E [@G]
""" """
...@@ -213,9 +213,9 @@ def test_debugprint(): ...@@ -213,9 +213,9 @@ def test_debugprint():
debugprint(G, file=s, ids='CHAR', stop_on_name=True) debugprint(G, file=s, ids='CHAR', stop_on_name=True)
s = s.getvalue() s = s.getvalue()
# The additional white space are needed! # The additional white space are needed!
reference = """Elemwise{add,no_inplace} [@A] '' reference = """Elemwise{add,no_inplace} [@A] ''
|Elemwise{add,no_inplace} [@B] 'C' |Elemwise{add,no_inplace} [@B] 'C'
|Elemwise{add,no_inplace} [@C] '' |Elemwise{add,no_inplace} [@C] ''
|D [@D] |D [@D]
|E [@E] |E [@E]
""" """
...@@ -231,13 +231,13 @@ def test_debugprint(): ...@@ -231,13 +231,13 @@ def test_debugprint():
debugprint(G, file=s, ids='') debugprint(G, file=s, ids='')
s = s.getvalue() s = s.getvalue()
# The additional white space are needed! # The additional white space are needed!
reference = """Elemwise{add,no_inplace} '' reference = """Elemwise{add,no_inplace} ''
|Elemwise{add,no_inplace} 'C' |Elemwise{add,no_inplace} 'C'
| |A | |A
| |B | |B
|Elemwise{add,no_inplace} '' |Elemwise{add,no_inplace} ''
|D |D
|E |E
""" """
if s != reference: if s != reference:
print('--' + s + '--') print('--' + s + '--')
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论