Skip to content

Commit

Permalink
get index of first pad
Browse files Browse the repository at this point in the history
  • Loading branch information
dyth committed Apr 5, 2019
1 parent e2daa7c commit 159144c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions babyai/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,8 @@ def forward(self, obs, memory, instr_embedding=None):
def _get_instr_embedding(self, instr):
if self.lang_model == 'gru':
_, hidden = self.instr_rnn(self.word_embedding(instr))
x = (instr <= 0).sum(dim=1)
print(x)
return hidden[-1]

elif self.lang_model in ['bigru', 'attgru']:
Expand Down

0 comments on commit 159144c

Please sign in to comment.