Skip to content

Commit

Permalink
add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
emjotde committed Jun 17, 2018
1 parent 227b0de commit ab848f8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/models/transformer.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ class Transformer {
qh = SplitHeads(qh, dimHeads); // [-4: beam depth * batch size, -3: num heads, -2: max length, -1: split vector dim]

Expr kh;
// Caching transformation of the encoder that should not be created again.
// @TODO: set this automatically by memoizing encoder context and memoization propagation (short-term)
if(!cache || (cache && cache_.count(prefix + "_keys") == 0)) {
auto Wk = graph->param(prefix + "_Wk",
{dimModel, dimModel},
Expand Down

0 comments on commit ab848f8

Please sign in to comment.