未验证 提交 0bbad002 编写于 作者: L liym27 提交者: GitHub

[dy2static] Revert to usage of 'assign' in test_transformer (#23777)

* Add the support of bool list for assign value, test=develop

* Fix the assign op test case for bool dtype, test=develop

* Revert to usage of 'assign' in test_transformer. test=develop
Co-authored-by: Nwawltor <fangzeyang0904@hotmail.com>
上级 f3d7db98
......@@ -584,8 +584,9 @@ class Transformer(Layer):
[[0.] + [-inf] * (beam_size - 1)] * batch_size,
dtype="float32"))
finished = fluid.layers.fill_constant(
shape=[batch_size, beam_size], value=0, dtype="bool")
finished = to_variable(
np.full(
[batch_size, beam_size], 0, dtype="bool"))
trg_word = layers.fill_constant(
shape=[batch_size * beam_size, 1], dtype="int64", value=bos_id)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册