提交 67064122 authored 作者: Frederic's avatar Frederic

Mark ProfileMode as deprecated at many places

上级 b7db88ac
...@@ -21,7 +21,7 @@ Theano defines the following modes by name: ...@@ -21,7 +21,7 @@ Theano defines the following modes by name:
- ``'FAST_COMPILE'``: Apply just a few graph optimizations and only use Python implementations. - ``'FAST_COMPILE'``: Apply just a few graph optimizations and only use Python implementations.
- ``'FAST_RUN'``: Apply all optimizations, and use C implementations where possible. - ``'FAST_RUN'``: Apply all optimizations, and use C implementations where possible.
- ``'DebugMode'``: A mode for debuging. See :ref:`DebugMode <debugmode>` for details. - ``'DebugMode'``: A mode for debuging. See :ref:`DebugMode <debugmode>` for details.
- ``'ProfileMode'``: A mode for profiling. See :ref:`ProfileMode <profilemode>` for details. - ``'ProfileMode'``: Deprecated, use the Theano flag :attr:`config.profile`.
- ``'DEBUG_MODE'``: Deprecated. Use the string DebugMode. - ``'DEBUG_MODE'``: Deprecated. Use the string DebugMode.
- ``'PROFILE_MODE'``: Deprecated. Use the string ProfileMode. - ``'PROFILE_MODE'``: Deprecated. Use the string ProfileMode.
......
...@@ -14,6 +14,10 @@ ...@@ -14,6 +14,10 @@
Guide Guide
===== =====
.. note::
ProfileMode is deprecated. Use :attr:`config.profile` instead.
To profile a Theano graph, a special mode called ProfileMode, must be passed as To profile a Theano graph, a special mode called ProfileMode, must be passed as
an argument when compiling your graph. Using ProfileMode is a three-step an argument when compiling your graph. Using ProfileMode is a three-step
process. process.
......
...@@ -258,7 +258,8 @@ import theano and print the config variable, as in: ...@@ -258,7 +258,8 @@ import theano and print the config variable, as in:
.. attribute:: mode .. attribute:: mode
String value: 'Mode', 'ProfileMode', 'DebugMode', 'FAST_RUN', 'FAST_COMPILE' String value: 'Mode', 'ProfileMode'(deprecated), 'DebugMode', 'FAST_RUN',
'FAST_COMPILE'
Default 'Mode' Default 'Mode'
......
...@@ -137,7 +137,7 @@ Theano defines the following modes by name: ...@@ -137,7 +137,7 @@ Theano defines the following modes by name:
- ``'DebugMode``: Verify the correctness of all optimizations, and compare C and Python - ``'DebugMode``: Verify the correctness of all optimizations, and compare C and Python
implementations. This mode can take much longer than the other modes, but can identify implementations. This mode can take much longer than the other modes, but can identify
several kinds of problems. several kinds of problems.
- ``'ProfileMode'``: Same optimization as FAST_RUN, but print some profiling information - ``'ProfileMode'``(deprecated): Same optimization as FAST_RUN, but print some profiling information.
The default mode is typically ``FAST_RUN``, but it can be controlled via The default mode is typically ``FAST_RUN``, but it can be controlled via
the configuration variable :attr:`config.mode`, the configuration variable :attr:`config.mode`,
...@@ -150,7 +150,7 @@ short name Full constructor ...@@ -150,7 +150,7 @@ short name Full constructor
``FAST_COMPILE`` ``compile.mode.Mode(linker='py', optimizer='fast_compile')`` Python implementations only, quick and cheap graph transformations ``FAST_COMPILE`` ``compile.mode.Mode(linker='py', optimizer='fast_compile')`` Python implementations only, quick and cheap graph transformations
``FAST_RUN`` ``compile.mode.Mode(linker='cvm', optimizer='fast_run')`` C implementations where available, all available graph transformations. ``FAST_RUN`` ``compile.mode.Mode(linker='cvm', optimizer='fast_run')`` C implementations where available, all available graph transformations.
``DebugMode`` ``compile.debugmode.DebugMode()`` Both implementations where available, all available graph transformations. ``DebugMode`` ``compile.debugmode.DebugMode()`` Both implementations where available, all available graph transformations.
``ProfileMode`` ``compile.profilemode.ProfileMode()`` C implementations where available, all available graph transformations, print profile information. ``ProfileMode`` ``compile.profilemode.ProfileMode()`` Deprecated. C implementations where available, all available graph transformations, print profile information.
================= =============================================================== =============================================================================== ================= =============================================================== ===============================================================================
.. Note:: .. Note::
...@@ -180,7 +180,7 @@ c|py_nogc no yes "++" As c|py, but without gc ...@@ -180,7 +180,7 @@ c|py_nogc no yes "++" As c|py, but without gc
c no yes "+" Use only C code (if none available for an op, raise an error) c no yes "+" Use only C code (if none available for an op, raise an error)
py yes yes "+++" Use only Python code py yes yes "+++" Use only Python code
c&py [#cpy2]_ no yes "+++++" Use C and Python code c&py [#cpy2]_ no yes "+++++" Use C and Python code
ProfileMode no no "++++" Compute some extra profiling info ProfileMode no no "++++" (Deprecated) Compute some extra profiling info
DebugMode no yes VERY HIGH Make many checks on what Theano computes DebugMode no yes VERY HIGH Make many checks on what Theano computes
============= ========= ================= ========= === ============= ========= ================= ========= ===
...@@ -253,6 +253,11 @@ For more detail, see :ref:`DebugMode<debugmode>` in the library. ...@@ -253,6 +253,11 @@ For more detail, see :ref:`DebugMode<debugmode>` in the library.
ProfileMode ProfileMode
=========== ===========
.. note::
ProfileMode is deprecated. Use :attr:`config.profile` instead.
Besides checking for errors, another important task is to profile your Besides checking for errors, another important task is to profile your
code. For this Theano uses a special mode called ProfileMode which has code. For this Theano uses a special mode called ProfileMode which has
to be passed as an argument to :func:`theano.function <function.function>`. to be passed as an argument to :func:`theano.function <function.function>`.
......
...@@ -1266,7 +1266,7 @@ def orig_function(inputs, outputs, mode=None, accept_inplace=False, ...@@ -1266,7 +1266,7 @@ def orig_function(inputs, outputs, mode=None, accept_inplace=False,
- FAST_COMPILE (minimal optimization) - FAST_COMPILE (minimal optimization)
- ProfileMode: allow to print a profile mode with mode.print_summary - ProfileMode(deprecated): allow to print a profile mode with mode.print_summary
- DebugMode: verify many internal conditions that are normally assumed - DebugMode: verify many internal conditions that are normally assumed
(slow) (slow)
......
...@@ -134,7 +134,7 @@ if rc == 0: ...@@ -134,7 +134,7 @@ if rc == 0:
# Keep the default linker the same as the one for the mode FAST_RUN # Keep the default linker the same as the one for the mode FAST_RUN
AddConfigVar('linker', AddConfigVar('linker',
("Default linker used if the theano flags mode is Mode " ("Default linker used if the theano flags mode is Mode "
"or ProfileMode"), "or ProfileMode(deprecated)"),
EnumStr('cvm', 'c|py', 'py', 'c', 'c|py_nogc', 'c&py', EnumStr('cvm', 'c|py', 'py', 'c', 'c|py_nogc', 'c&py',
'vm', 'vm_nogc', 'cvm_nogc'), 'vm', 'vm_nogc', 'cvm_nogc'),
in_c_key=False) in_c_key=False)
...@@ -142,7 +142,7 @@ else: ...@@ -142,7 +142,7 @@ else:
# g++ is not present, linker should default to python only # g++ is not present, linker should default to python only
AddConfigVar('linker', AddConfigVar('linker',
("Default linker used if the theano flags mode is Mode " ("Default linker used if the theano flags mode is Mode "
"or ProfileMode"), "or ProfileMode(deprecated)"),
EnumStr('py', 'vm', 'vm_nogc'), EnumStr('py', 'vm', 'vm_nogc'),
in_c_key=False) in_c_key=False)
_logger.warning('g++ not detected ! Theano will be unable to execute ' _logger.warning('g++ not detected ! Theano will be unable to execute '
...@@ -174,7 +174,7 @@ AddConfigVar('allow_gc', ...@@ -174,7 +174,7 @@ AddConfigVar('allow_gc',
#Keep the default optimizer the same as the one for the mode FAST_RUN #Keep the default optimizer the same as the one for the mode FAST_RUN
AddConfigVar('optimizer', AddConfigVar('optimizer',
("Default optimizer. If not None, will use this linker with the Mode " ("Default optimizer. If not None, will use this linker with the Mode "
"object (not ProfileMode or DebugMode)"), "object (not ProfileMode(deprecated) or DebugMode)"),
EnumStr('fast_run', 'merge', 'fast_compile', 'None'), EnumStr('fast_run', 'merge', 'fast_compile', 'None'),
in_c_key=False) in_c_key=False)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论