提交 391b1322 authored 作者: Olivier Delalleau's avatar Olivier Delalleau

PEP8

上级 062ead13
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
The `Op` class is the base interface for all operations The `Op` class is the base interface for all operations
compatible with `gof`'s :doc:`graph` routines. compatible with `gof`'s :doc:`graph` routines.
""" """
__authors__ = "theano-dev" __authors__ = "theano-dev"
__copyright__ = "(c) 2010, Universite de Montreal" __copyright__ = "(c) 2010, Universite de Montreal"
__license__ = "3-clause BSD License" __license__ = "3-clause BSD License"
...@@ -463,7 +464,6 @@ class PureOp(object): ...@@ -463,7 +464,6 @@ class PureOp(object):
# Python implementation # # Python implementation #
######################### #########################
def R_op(self, inputs, eval_points): def R_op(self, inputs, eval_points):
""" """
...@@ -494,7 +494,6 @@ class PureOp(object): ...@@ -494,7 +494,6 @@ class PureOp(object):
"own op, implement the R_op method." % "own op, implement the R_op method." %
(self, self.__class__.__name__)) (self, self.__class__.__name__))
def perform(self, node, inputs, output_storage): def perform(self, node, inputs, output_storage):
""" """
Required: Calculate the function on the inputs and put the variables in the Required: Calculate the function on the inputs and put the variables in the
...@@ -624,6 +623,7 @@ class Op(utils.object2, PureOp, CLinkerOp): ...@@ -624,6 +623,7 @@ class Op(utils.object2, PureOp, CLinkerOp):
rval.lazy = False rval.lazy = False
return rval return rval
def get_test_value(v): def get_test_value(v):
""" """
Extract test value from `v`. Raises AttributeError if there is none. Extract test value from `v`. Raises AttributeError if there is none.
......
...@@ -327,9 +327,11 @@ def ifelse(condition, then_branch, else_branch, name=None): ...@@ -327,9 +327,11 @@ def ifelse(condition, then_branch, else_branch, name=None):
new_else_branch = [] new_else_branch = []
for then_branch_elem, else_branch_elem in izip(then_branch, else_branch): for then_branch_elem, else_branch_elem in izip(then_branch, else_branch):
if not isinstance(then_branch_elem, theano.Variable): if not isinstance(then_branch_elem, theano.Variable):
then_branch_elem = theano.tensor.as_tensor_variable(then_branch_elem) then_branch_elem = theano.tensor.as_tensor_variable(
then_branch_elem)
if not isinstance(else_branch_elem, theano.Variable): if not isinstance(else_branch_elem, theano.Variable):
else_branch_elem = theano.tensor.as_tensor_variable(else_branch_elem) else_branch_elem = theano.tensor.as_tensor_variable(
else_branch_elem)
if then_branch_elem.type != else_branch_elem.type: if then_branch_elem.type != else_branch_elem.type:
# If one of them is a TensorType, and the other one can be # If one of them is a TensorType, and the other one can be
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论