From 503d40a7734b9a655d95e3548c5b18d0aeaf8403 Mon Sep 17 00:00:00 2001 From: guosheng Date: Wed, 13 May 2020 10:28:36 +0800 Subject: [PATCH] Fix example code of DynamicDecode in hapi.text. text=develop --- hapi/text/text.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hapi/text/text.py b/hapi/text/text.py index 97803cb..de392f5 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]) -- GitLab