Skip to content

Commit

Permalink
fix assertion for even number of batch size
Browse files Browse the repository at this point in the history
  • Loading branch information
bzantium authored Jul 4, 2019
1 parent 4c574d6 commit 7ef2f2d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def relative_positional_encoding(qlen, klen, d_model, clamp_len, attn_type,

if bsz is not None:
# With bi_data, the batch size should be divisible by 2.
assert bsz%2 == 0
tf.debugging.assert_equal(bsz % 2, 0)
fwd_pos_emb = positional_embedding(fwd_pos_seq, inv_freq, bsz//2)
bwd_pos_emb = positional_embedding(bwd_pos_seq, inv_freq, bsz//2)
else:
Expand Down

2 comments on commit 7ef2f2d

@vochicong
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this fix still not merged into master branch? @bzantium
Related to #106 @graykode.

@graykode
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vochicong That permission is on to @zihangdai , I cant manger it :(

Please sign in to comment.