提交 7b8f4941 authored 作者: Olivier Delalleau's avatar Olivier Delalleau

PEP8 and minor rephrasing

The rephrasing is to avoid using 'type' for class name, given that 'type' has a special meaning in Theano.
上级 40144ef1
...@@ -468,17 +468,17 @@ class PureOp(object): ...@@ -468,17 +468,17 @@ class PureOp(object):
returns: a list of n elements returns: a list of n elements
rval[i] should be Rop(f = f_i(inputs), rval[i] should be Rop(f=f_i(inputs),
wrt = inputs, wrt=inputs,
eval_points = eval_points) eval_points=eval_points)
""" """
raise NotImplementedError(
raise NotImplementedError(str(self)+' of type '+str(self.__class__.__name__) "%s of class %s does not "
+" does not "
"implement R_op. If this is a theano op, write to the " "implement R_op. If this is a theano op, write to the "
"theano-dev mailing list for assistance. If it is your " "theano-dev mailing list for assistance. If it is your "
"own op, implement the R_op method.") "own op, implement the R_op method." %
(self, self.__class__.__name__))
def perform(self, node, inputs, output_storage): def perform(self, node, inputs, output_storage):
......
...@@ -94,8 +94,8 @@ def Rop(f, wrt, eval_points): ...@@ -94,8 +94,8 @@ def Rop(f, wrt, eval_points):
assert len(wrt) == len(eval_points) assert len(wrt) == len(eval_points)
#check that each element of wrt corresponds to an element # Check that each element of wrt corresponds to an element
#of eval_points with the same dimensionality # of eval_points with the same dimensionality.
for pack in enumerate(zip(wrt, eval_points)): for pack in enumerate(zip(wrt, eval_points)):
i = pack[0] i = pack[0]
wrt_elem, eval_point = pack[1] wrt_elem, eval_point = pack[1]
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论