> How about something like
>
> theano.len(v) means v.type.symbolic_len(v)
>
> So types that implement symbolic_len work with theano.len?
Can we call it something other than theano.len? Maybe theano.length?
Even though it's never a good idea to "from foo import *", people routinely
do it, and this would be a nasty surprise if the len() builtin stopped
working.
Another option would be to make it work like builtin len() for non-TensorType
objects.
David
On Fri, Nov 19, 2010 at 03:47:05PM -0500, James Bergstra wrote:Can we call it something other than theano.len? Maybe theano.length?
> How about something like
>
> theano.len(v) means v.type.symbolic_len(v)
>
> So types that implement symbolic_len work with theano.len?
Even though it's never a good idea to "from foo import *", people routinely
do it, and this would be a nasty surprise if the len() builtin stopped
working.
Another option would be to make it work like builtin len() for non-TensorType
objects.