提交 2dca5722 authored 作者: Frederic's avatar Frederic

Add tag trace to shared variable to remember where we created them.

上级 64d80b0e
......@@ -9,7 +9,7 @@ import logging
import numpy
# Theano imports
from theano.gof import Container, Variable, generic
from theano.gof import Container, Variable, generic, utils
_logger = logging.getLogger('theano.compile.sharedvalue')
......@@ -186,8 +186,10 @@ def shared(value, name=None, strict=False, allow_downcast=None, **kwargs):
for ctor in reversed(shared.constructors):
try:
return ctor(value, name=name, strict=strict,
var = ctor(value, name=name, strict=strict,
allow_downcast=allow_downcast, **kwargs)
utils.add_tag_trace(var)
return var
except TypeError:
continue
# This may happen when kwargs were supplied
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论