提交 148168f6 authored 作者: James Bergstra's avatar James Bergstra

Added _as_TensorVariable mechanism to as_tensor_variable

上级 598c8351
......@@ -84,6 +84,8 @@ def as_tensor_variable(x, name = None, ndim=None):
- `TypeError`: raised if `x` cannot be converted to a TensorType Variable
"""
if hasattr(x, '_as_TensorVariable'):
return x._as_TensorVariable()
if isinstance(x, gof.Apply):
#TODO: use Apply's default output mechanism
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论