Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
39 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
include requirements-dev.txt | ||
include requirements.txt | ||
include README.rst | ||
include version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__version__ = "0.3.5" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# coding=utf-8 | ||
# | ||
# created by kpe on 30.Jul.2019 at 16:41 | ||
# | ||
|
||
from __future__ import absolute_import, division, print_function | ||
|
||
|
||
import unittest | ||
|
||
import bert | ||
|
||
import tensorflow as tf | ||
|
||
tf.enable_eager_execution() | ||
|
||
|
||
class TestAttention(unittest.TestCase): | ||
|
||
def test_attention(self): | ||
am = bert.AttentionLayer.create_attention_mask(from_shape=[2, 3, 5], # B,S,.. | ||
input_mask=[[2], [1]] # B,seq_len | ||
) | ||
print(am) # [batch_size, from_seq_len, seq_len] | ||
|