You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for this very interesting project, I came across it from HN and your talk.
I was looking at the syntax for broadcast_define, which is given by @nps.broadcast_define( (('n',), ('n',)) ) or @nps.broadcast_define( (('n',), ('n',), ())) in the examples.
I am not sure whether you are familiar with numpy's einsum function. I quite like the intuitive style of writing indices.
I am wondering whether it could be reused here. In that case, one could write something like: @nps.broadcast_define('n,n->') @nps.broadcast_define('n,mn->m')
However, I am not sure how complex the parser of einsum is and whether it can be easily reused here.
Maybe one could also consider a concat/stacking API that is based on einsum notation: cat(arr13,arr3) -> einstack(arr13,arr3,'ij,j->kij') glue(arr13,arr3) -> einstack(arr13,arr3,'ij,ij->ij')
I am a bit scared of the automatic adding of leading dimensions, because it may hide passing the wrong array. Is there a way to turn it off?
The text was updated successfully, but these errors were encountered:
I am not sure whether you are familiar with numpy's einsum function. I
quite like the intuitive style of writing indices. I am wondering
whether it could be reused here. In that case, one could write
something like: @nps.broadcast_define('n,n->')
@nps.broadcast_define('n,mn->m')
2 Maybe one could also consider a concat/stacking API that is based on
einsum notation: cat(arr13,arr3) -> einstack(arr13,arr3,'ij,j->kij')
glue(arr13,arr3) -> einstack(arr13,arr3,'ij,ij->ij')
Hi. I don't have plans for any new features for numpysane right now
(busy with other things). But if you want to contribute some of this, we
can certainly talk about it.
3 I am a bit scared of the automatic adding of leading dimensions,
because it may hide passing the wrong array. Is there a way to turn it
off?
No. This is a core part of the broadcasting logic. This does imply one
particular interpretation of the input, as you say, but it enables MUCH
nicer code, which makes it worth it, in my opinion.
Hi @dkogan,
Thanks for this very interesting project, I came across it from HN and your talk.
@nps.broadcast_define( (('n',), ('n',)) )
or@nps.broadcast_define( (('n',), ('n',), ()))
in the examples.I am not sure whether you are familiar with numpy's einsum function. I quite like the intuitive style of writing indices.
I am wondering whether it could be reused here. In that case, one could write something like:
@nps.broadcast_define('n,n->')
@nps.broadcast_define('n,mn->m')
However, I am not sure how complex the parser of einsum is and whether it can be easily reused here.
Maybe one could also consider a concat/stacking API that is based on einsum notation:
cat(arr13,arr3) -> einstack(arr13,arr3,'ij,j->kij')
glue(arr13,arr3) -> einstack(arr13,arr3,'ij,ij->ij')
I am a bit scared of the automatic adding of leading dimensions, because it may hide passing the wrong array. Is there a way to turn it off?
The text was updated successfully, but these errors were encountered: