Skip to content

Commit 88aa2d8

Browse files
authored
Fix order of inputs in infer() of label_semantic example (#10993)
1 parent 580340e commit 88aa2d8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

python/paddle/fluid/tests/book/high-level-api/label_semantic_roles/test_label_semantic_roles_newapi.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,6 @@ def infer(use_cuda, inference_program, params_dirname):
217217
# The range of random integers is [low, high]
218218
word = fluid.create_random_int_lodtensor(
219219
lod, base_shape, place, low=0, high=WORD_DICT_LEN - 1)
220-
pred = fluid.create_random_int_lodtensor(
221-
lod, base_shape, place, low=0, high=PRED_DICT_LEN - 1)
222220
ctx_n2 = fluid.create_random_int_lodtensor(
223221
lod, base_shape, place, low=0, high=WORD_DICT_LEN - 1)
224222
ctx_n1 = fluid.create_random_int_lodtensor(
@@ -229,18 +227,20 @@ def infer(use_cuda, inference_program, params_dirname):
229227
lod, base_shape, place, low=0, high=WORD_DICT_LEN - 1)
230228
ctx_p2 = fluid.create_random_int_lodtensor(
231229
lod, base_shape, place, low=0, high=WORD_DICT_LEN - 1)
230+
pred = fluid.create_random_int_lodtensor(
231+
lod, base_shape, place, low=0, high=PRED_DICT_LEN - 1)
232232
mark = fluid.create_random_int_lodtensor(
233233
lod, base_shape, place, low=0, high=MARK_DICT_LEN - 1)
234234

235235
results = inferencer.infer(
236236
{
237237
'word_data': word,
238-
'verb_data': pred,
239238
'ctx_n2_data': ctx_n2,
240239
'ctx_n1_data': ctx_n1,
241240
'ctx_0_data': ctx_0,
242241
'ctx_p1_data': ctx_p1,
243242
'ctx_p2_data': ctx_p2,
243+
'verb_data': pred,
244244
'mark_data': mark
245245
},
246246
return_numpy=False)

0 commit comments

Comments
 (0)