Skip to content

Commit 8a91c3f

Browse files
committed
fix bug
1 parent 6ea9d56 commit 8a91c3f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ELMo.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,10 @@ def step(self, seqs):
6161

6262
def get_emb(self, seqs):
6363
fxs, bxs = self.call(seqs)
64-
xs = [tf.concat((f[:, :-1, :], b[:, 1:, :]), axis=2).numpy() for f, b in zip(fxs, bxs)]
64+
xs = [
65+
tf.concat((fxs[0][:, 1:, :], bxs[0][:, :-1, :]), axis=2).numpy() # from word embedding
66+
] + [
67+
tf.concat((f[:, :-1, :], b[:, 1:, :]), axis=2).numpy() for f, b in zip(fxs[1:], bxs[1:])] # from sentence embedding
6568
for x in xs:
6669
print("layers shape=", x.shape)
6770
return xs

0 commit comments

Comments
 (0)