"unpack" a batched expression

27 views
Skip to first unread message

Xiang Yu

unread,
Apr 29, 2018, 10:30:59 AM4/29/18
to DyNet Users
Hi, 

I'm looking for a way to "unpack" a batched expression into list of expressions, like the reverse of the concatenate_to_batch() function. I couldn't find such operation in the doc, is there a simple way to do this without doing a forward pass? Thanks!

Bhat Irshad

unread,
Aug 17, 2018, 6:34:54 AM8/17/18
to DyNet Users
Any updates on this one, i am looking for something similar.

I have an rnn output batch of the size `((64,), 11)` and i want to pick the last column. I tried `dy.select_cols(fw_exps[0], [last_col_id])` and got `ValueError: Bad arguments in SelectCols: [{64X11}]`.

Is there something like `dy.select_cols_batch`.

Brian Lester

unread,
Sep 28, 2018, 9:14:09 AM9/28/18
to DyNet Users
```
(_, B) = x.dim()
exps = [dy.pick_batch_elem(x, i) for i in range(B)
```
Reply all
Reply to author
Forward
0 new messages