Skip to content

Commit f1016f7

Browse files
Merge pull request #201 from michaelosthege/fix-94
Refactor config code
2 parents 0d34af2 + 9cb1464 commit f1016f7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+2680
-2635
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ jobs:
132132
pip install -q -r requirements.txt
133133
mamba list && pip freeze
134134
python -c 'import theano; print(theano.config.__str__(print_doc=False))'
135-
python -c 'import theano; assert(theano.config.blas.ldflags != "")'
135+
python -c 'import theano; assert(theano.config.blas__ldflags != "")'
136136
env:
137137
PYTHON_VERSION: ${{ matrix.python-version }}
138138

conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def pytest_sessionstart(session):
77
os.environ["THEANO_FLAGS"] = ",".join(
88
[
99
os.environ.setdefault("THEANO_FLAGS", ""),
10-
"warn.ignore_bug_before=all,on_opt_error=raise,on_shape_error=raise",
10+
"warn__ignore_bug_before=all,on_opt_error=raise,on_shape_error=raise",
1111
]
1212
)
1313

doc/acknowledgement.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ Acknowledgements
1515
* All Theano users that have given us feedback.
1616
* The GPU implementation of tensordot is based on code from Tijmen
1717
Tieleman's `gnumpy <http://www.cs.toronto.edu/~tijmen/gnumpy.html>`_
18-
* The original version of the function ``cpuCount()`` in the file
19-
`theano/misc/cpucount.py` come from the project `pyprocessing
20-
<http://pyprocessing.berlios.de/>`_. It is available under the same license
21-
as Theano.
2218
* Our random number generator implementation on CPU and GPU uses the MRG31k3p algorithm that is described in:
2319

2420
P. L'Ecuyer and R. Touzin, `Fast Combined Multiple Recursive Generators with Multipliers of the form a = +/- 2^d +/- 2^e <http://www.informs-sim.org/wsc00papers/090.PDF>`_, Proceedings of the 2000 Winter Simulation Conference, Dec. 2000, 683--689.

doc/extending/extending_theano.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ returns the right answer. If you detect an error, you must raise an
580580
We call ``utt.assert_allclose(expected_value, value)`` to compare
581581
NumPy ndarray.This raise an error message with more information. Also,
582582
the default tolerance can be changed with the Theano flags
583-
``config.tensor.cmp_sloppy`` that take values in 0, 1 and 2. The
583+
``config.tensor__cmp_sloppy`` that take values in 0, 1 and 2. The
584584
defaul value do the most strict comparison, 1 and 2 make less strict
585585
comparison.
586586

doc/extending/extending_theano_c.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1034,7 +1034,7 @@ Using GDB to debug Op's C code
10341034
When debugging C code, it can be useful to use GDB for code compiled
10351035
by Theano.
10361036

1037-
For this, you must enable this Theano: `cmodule.remove_gxx_opt=True`.
1037+
For this, you must enable this Theano: `cmodule__remove_gxx_opt=True`.
10381038
For the GPU, you must add in this second flag `nvcc.flags=-g` (it slow
10391039
down computation on the GPU, but it is enabled by default on the CPU).
10401040

doc/extending/pipeline.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ case if ``borrow`` was True, the thunk would be allowed to reuse (or
108108

109109
The compile cache is based upon the C++ code of the graph to be compiled.
110110
So, if you change compilation configuration variables, such as
111-
:attr:`config.blas.ldflags`, you will need to manually remove your compile cache,
111+
:attr:`config.blas__ldflags`, you will need to manually remove your compile cache,
112112
using ``Theano/bin/theano-cache clear``
113113

114114
Theano also implements a lock mechanism that prevents

doc/extending/unittest.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,9 @@ The behaviour of ``seed_rng`` is as follows:
258258

259259
* If an explicit seed is given, it will be used for seeding numpy's rng.
260260

261-
* If not, it will use ``config.unittests.rseed`` (its default value is ``666``).
261+
* If not, it will use ``config.unittests__rseed`` (its default value is ``666``).
262262

263-
* If ``config.unittests.rseed`` is set to ``"random"``, it will seed the rng with
263+
* If ``config.unittests__rseed`` is set to ``"random"``, it will seed the rng with
264264
None, which is equivalent to seeding with a random seed.
265265

266266

@@ -272,7 +272,7 @@ a higher confidence that the variables are correct), while still
272272
making sure unittests are deterministic.
273273

274274
Users who prefer their unittests to be random (when run on their local
275-
machine) can simply set ``config.unittests.rseed`` to ``'random'`` (see
275+
machine) can simply set ``config.unittests__rseed`` to ``'random'`` (see
276276
:mod:`config`).
277277

278278
Similarly, to provide a seed to ``numpy.random.RandomState``, simply use:

doc/faq.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ correct shape. The shape could change if the shapes of the inputs change.
9797

9898
.. note::
9999

100-
With :attr:`preallocate <config.gpuarray.preallocate>`, this isn't
100+
With :attr:`preallocate <config.gpuarray__preallocate>`, this isn't
101101
very useful with GPU anymore.
102102

103103
.. _unsafe_optimization:
@@ -176,7 +176,7 @@ but requires that all nodes in the graph have a C implementation:
176176
New GPU backend using libgpuarray
177177
---------------------------------
178178

179-
The new theano GPU backend (:ref:`gpuarray`) uses ``config.gpuarray.preallocate`` for GPU memory allocation.
179+
The new theano GPU backend (:ref:`gpuarray`) uses ``config.gpuarray__preallocate`` for GPU memory allocation.
180180

181181
Related Projects
182182
----------------

doc/internal/how_to_release.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Update the fallback version in ``theano/version.py``.
4242
Update the version in ``doc/install_generic.inc``.
4343

4444
Update the code and the documentation for the theano flags
45-
``warn.ignore_bug_before`` to accept the new version. You must modify the
45+
``warn__ignore_bug_before`` to accept the new version. You must modify the
4646
file ``theano/configdefaults.py`` and ``doc/library/config.txt``.
4747

4848
Tag the release

doc/library/compile/debugmode.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,36 +89,36 @@ Reference
8989

9090
If there are internal errors, this mode will raise an `DebugModeError` exception.
9191

92-
.. attribute:: stability_patience = config.DebugMode.patience
92+
.. attribute:: stability_patience = config.DebugMode__patience
9393

9494
When checking for the stability of optimization, recompile the graph this many times.
9595
Default 10.
9696

97-
.. attribute:: check_c_code = config.DebugMode.check_c
97+
.. attribute:: check_c_code = config.DebugMode__check_c
9898

9999
Should we evaluate (and check) the `c_code` implementations?
100100

101101
``True`` -> yes, ``False`` -> no.
102102

103103
Default yes.
104104

105-
.. attribute:: check_py_code = config.DebugMode.check_py
105+
.. attribute:: check_py_code = config.DebugMode__check_py
106106

107107
Should we evaluate (and check) the `perform` implementations?
108108

109109
``True`` -> yes, ``False`` -> no.
110110

111111
Default yes.
112112

113-
.. attribute:: check_isfinite = config.DebugMode.check_finite
113+
.. attribute:: check_isfinite = config.DebugMode__check_finite
114114

115115
Should we check for (and complain about) ``NaN``/``Inf`` ndarray elements?
116116

117117
``True`` -> yes, ``False`` -> no.
118118

119119
Default yes.
120120

121-
.. attribute:: require_matching_strides = config.DebugMode.check_strides
121+
.. attribute:: require_matching_strides = config.DebugMode__check_strides
122122

123123
Check for (and complain about) Ops whose python and C
124124
outputs are ndarrays with different strides. (This can catch bugs, but

0 commit comments

Comments
 (0)