diff --git a/hapi/text/text.py b/hapi/text/text.py index 97803cb10d8f5772016141090c942e41d7cb8463..de392f5cfcf40032bc5d0bbfa0c53bded52efbe6 100644 --- a/hapi/text/text.py +++ b/hapi/text/text.py @@ -1808,6 +1808,8 @@ class DynamicDecode(Layer): from paddle.fluid.layers import BeamSearchDecoder from paddle.incubate.hapi.text import StackedLSTMCell, DynamicDecode + paddle.enable_dygraph() + vocab_size, d_model, = 100, 32 encoder_output = paddle.rand((2, 4, d_model)) trg_embeder = fluid.dygraph.Embedding(size=[vocab_size, d_model])