[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: wawltor <fangzeyang0904@hotmail.com>
revert-23830-2.0-beta
liym27 5 years ago committed by GitHub
parent f3d7db98f1
commit 0bbad002df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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)

Loading…
Cancel
Save