提交 3ce74063 authored 作者: Frederic's avatar Frederic

Added a faq with an entry on the missing __len__ function.

上级 1a1ea829
.. _faq:
==========================
Frequently Asked Questions
==========================
TypeError: object of type 'TensorVariable' has no len()
--------------------------------------------------------------
If you receive this error:
.. code-block:: python
TypeError: object of type 'TensorVariable' has no len()
We can't implement the __len__ function on Theano Varible. This is
because Python request that we return an integer, but we can't do this
as we are working with symbolic variable. You can use `var.shape[0]`
as a workaround.
Also we can't change the error to a better one for some other Python
internal behavior that we can't change.
......@@ -39,4 +39,4 @@ you out.
shape_info
remarks
debug_faq
faq
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论