Skip to content

Commit 6133728

Browse files
committed
fix error
1 parent 69e0af5 commit 6133728

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -215,21 +215,21 @@ def infer(use_cuda, inference_program, save_path):
215215
lod = [[3, 4, 2]]
216216
base_shape = [1]
217217
# The range of random integers is [low, high]
218-
word = fluid.create_random_lodtensor(
218+
word = fluid.create_random_int_lodtensor(
219219
lod, base_shape, place, low=0, high=WORD_DICT_LEN - 1)
220-
pred = fluid.create_random_lodtensor(
220+
pred = fluid.create_random_int_lodtensor(
221221
lod, base_shape, place, low=0, high=PRED_DICT_LEN - 1)
222-
ctx_n2 = fluid.create_random_lodtensor(
222+
ctx_n2 = fluid.create_random_int_lodtensor(
223223
lod, base_shape, place, low=0, high=WORD_DICT_LEN - 1)
224-
ctx_n1 = fluid.create_random_lodtensor(
224+
ctx_n1 = fluid.create_random_int_lodtensor(
225225
lod, base_shape, place, low=0, high=WORD_DICT_LEN - 1)
226-
ctx_0 = fluid.create_random_lodtensor(
226+
ctx_0 = fluid.create_random_int_lodtensor(
227227
lod, base_shape, place, low=0, high=WORD_DICT_LEN - 1)
228-
ctx_p1 = fluid.create_random_lodtensor(
228+
ctx_p1 = fluid.create_random_int_lodtensor(
229229
lod, base_shape, place, low=0, high=WORD_DICT_LEN - 1)
230-
ctx_p2 = fluid.create_random_lodtensor(
230+
ctx_p2 = fluid.create_random_int_lodtensor(
231231
lod, base_shape, place, low=0, high=WORD_DICT_LEN - 1)
232-
mark = fluid.create_random_lodtensor(
232+
mark = fluid.create_random_int_lodtensor(
233233
lod, base_shape, place, low=0, high=MARK_DICT_LEN - 1)
234234

235235
results = inferencer.infer(

python/paddle/fluid/tests/book/test_label_semantic_roles.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -261,21 +261,21 @@ def infer(use_cuda, save_dirname=None):
261261
lod = [[3, 4, 2]]
262262
base_shape = [1]
263263
# The range of random integers is [low, high]
264-
word = fluid.create_random_lodtensor(
264+
word = fluid.create_random_int_lodtensor(
265265
lod, base_shape, place, low=0, high=word_dict_len - 1)
266-
pred = fluid.create_random_lodtensor(
266+
pred = fluid.create_random_int_lodtensor(
267267
lod, base_shape, place, low=0, high=pred_dict_len - 1)
268-
ctx_n2 = fluid.create_random_lodtensor(
268+
ctx_n2 = fluid.create_random_int_lodtensor(
269269
lod, base_shape, place, low=0, high=word_dict_len - 1)
270-
ctx_n1 = fluid.create_random_lodtensor(
270+
ctx_n1 = fluid.create_random_int_lodtensor(
271271
lod, base_shape, place, low=0, high=word_dict_len - 1)
272-
ctx_0 = fluid.create_random_lodtensor(
272+
ctx_0 = fluid.create_random_int_lodtensor(
273273
lod, base_shape, place, low=0, high=word_dict_len - 1)
274-
ctx_p1 = fluid.create_random_lodtensor(
274+
ctx_p1 = fluid.create_random_int_lodtensor(
275275
lod, base_shape, place, low=0, high=word_dict_len - 1)
276-
ctx_p2 = fluid.create_random_lodtensor(
276+
ctx_p2 = fluid.create_random_int_lodtensor(
277277
lod, base_shape, place, low=0, high=word_dict_len - 1)
278-
mark = fluid.create_random_lodtensor(
278+
mark = fluid.create_random_int_lodtensor(
279279
lod, base_shape, place, low=0, high=mark_dict_len - 1)
280280

281281
# Construct feed as a dictionary of {feed_target_name: feed_target_data}

0 commit comments

Comments
 (0)