提交 1efa650e authored 作者: Razvan Pascanu's avatar Razvan Pascanu

fixed code to consider any constant ( not only tensor.Constant)

上级 efbc18c4
...@@ -42,8 +42,7 @@ def safe_new(x, tag = ''): ...@@ -42,8 +42,7 @@ def safe_new(x, tag = ''):
nw_name = x.name + tag nw_name = x.name + tag
else: else:
nw_name = None nw_name = None
# Should it be theano.Constant? What is the difference between the two? if isinstance(x, theano.Constant):
if isinstance(x, tensor.Constant):
return x.clone() return x.clone()
# Note, as_tensor_variable will convert the Scalar into a # Note, as_tensor_variable will convert the Scalar into a
# TensorScalar that will require a ScalarFromTensor op, # TensorScalar that will require a ScalarFromTensor op,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论