Skip to content

Commit

Permalink
Merge pull request #747 from ufal/fix_stateful_context
Browse files Browse the repository at this point in the history
Fix StatefulContext
  • Loading branch information
cifkao authored Aug 26, 2018
2 parents c59d1c9 + 7e2299b commit dd26a0f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions neuralmonkey/attention/stateful_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def attention(self,
AttentionLoopState]:
context = tf.reshape(self.attention_states,
[-1, self.context_vector_size])
weights = tf.ones(shape=[tf.shape(context)[0]])
weights = tf.ones(shape=[self.batch_size, 1])

next_contexts = tf.concat(
[loop_state.contexts, tf.expand_dims(context, 0)], 0)
Expand All @@ -77,8 +77,7 @@ def attention(self,

def initial_loop_state(self) -> AttentionLoopState:
return empty_attention_loop_state(
self.batch_size,
tf.shape(self.attention_states)[1],
self.batch_size, 1,
self.context_vector_size)

def finalize_loop(self, key: str,
Expand Down

0 comments on commit dd26a0f

Please sign in to comment.