提交 4dc285b2 authored 作者: James Bergstra's avatar James Bergstra

Merge pull request #25 from nouiz/coding_style

Coding style
...@@ -26,6 +26,17 @@ To obtain developer access: register with `GitHub ...@@ -26,6 +26,17 @@ To obtain developer access: register with `GitHub
<http://www.github.com/>`_ and create a fork of `Theano <http://www.github.com/>`_ and create a fork of `Theano
<http://www.github.com/Theano/Theano>`_. <http://www.github.com/Theano/Theano>`_.
Coding style
------------
We didn't had any coding style when we started Theano. We now use
`this one
<http://deeplearning.net/software/pylearn/v2_planning/API_coding_style.html>`_
except that we don't use the numpy docstring standard.
We do not plan to change all existing code to follow this coding
style, but as we modify the code, we update it accordingly.
Typical development workflow Typical development workflow
---------------------------- ----------------------------
......
...@@ -314,7 +314,6 @@ def streamline(env, thunks, order, post_thunk_old_storage = None, no_recycling = ...@@ -314,7 +314,6 @@ def streamline(env, thunks, order, post_thunk_old_storage = None, no_recycling =
thunk() thunk()
for old_s in old_storage: for old_s in old_storage:
old_s[0] = None old_s[0] = None
# N.B.: used instead of except: to not catch KeyboardInterrupt
except Exception: except Exception:
raise_with_op(node) raise_with_op(node)
f = streamline_default_f f = streamline_default_f
...@@ -326,7 +325,6 @@ def streamline(env, thunks, order, post_thunk_old_storage = None, no_recycling = ...@@ -326,7 +325,6 @@ def streamline(env, thunks, order, post_thunk_old_storage = None, no_recycling =
try: try:
for thunk, node in thunk_node_list: for thunk, node in thunk_node_list:
thunk() thunk()
# N.B.: used instead of except: to not catch KeyboardInterrupt
except Exception: except Exception:
raise_with_op(node) raise_with_op(node)
f = streamline_nice_errors_f f = streamline_nice_errors_f
...@@ -587,7 +585,6 @@ class WrapLinker(Linker): ...@@ -587,7 +585,6 @@ class WrapLinker(Linker):
for i, (thunks, node) in enumerate(zip(thunk_groups, order)): for i, (thunks, node) in enumerate(zip(thunk_groups, order)):
try: try:
wrapper(i, node, *thunks) wrapper(i, node, *thunks)
# N.B.: used instead of except: to not catch KeyboardInterrupt
except Exception: except Exception:
raise_with_op(node) raise_with_op(node)
f.thunk_groups = thunk_groups f.thunk_groups = thunk_groups
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论