提交 a016e143 authored 作者: Razvan Pascanu's avatar Razvan Pascanu

added conventions to make_node

The make_node function used to check if inputs of the scan op have the same type. In order to do so it has to parse them, This comments indicate the convention in naming variables when this check is done (so that there is no confusion between the variables representing the inputs of the lambda functions, i.e. slices of the inputs and the actual inputs).
上级 a61eb78f
......@@ -148,11 +148,22 @@ class Scan(PureOp):
self._hash_inner_graph = self.info['gpu_hash']
def make_node(self, *inputs):
"""
Conventions:
inner_? - the variable corresponding to ? in the inner function
of scan (the lambda function executed at every time
step)
outer_? - the variable corresponding to ? in the outer graph,
i.e. the main graph (where the scan op lives)
inner_?_out - the variable representing the new value of ? after
executing one step of scan (i.e. outputs given by
the inner function)
"""
assert numpy.all(isinstance(i, gof.Variable) for i in inputs)
# assert dtype is consistent
err_msg1 = ('When compiling the inner function of scan the '
'following error has been encountered: The '
'%s %s( the entry number %d) has dtype '
'%s %s (argument number %d) has dtype '
'%s. The corresponding slice %s however has'
' dtype %s. This should never happen, please '
'report to theano-dev mailing list'
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论