From 6133728a67445672fad77ecaf4d37b6c074022f5 Mon Sep 17 00:00:00 2001 From: Kexin Zhao Date: Wed, 23 May 2018 17:59:16 -0700 Subject: [PATCH] fix error --- .../test_label_semantic_roles_newapi.py | 16 ++++++++-------- .../tests/book/test_label_semantic_roles.py | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/python/paddle/fluid/tests/book/high-level-api/label_semantic_roles/test_label_semantic_roles_newapi.py b/python/paddle/fluid/tests/book/high-level-api/label_semantic_roles/test_label_semantic_roles_newapi.py index e32b130ac7..f434498814 100755 --- a/python/paddle/fluid/tests/book/high-level-api/label_semantic_roles/test_label_semantic_roles_newapi.py +++ b/python/paddle/fluid/tests/book/high-level-api/label_semantic_roles/test_label_semantic_roles_newapi.py @@ -215,21 +215,21 @@ def infer(use_cuda, inference_program, save_path): lod = [[3, 4, 2]] base_shape = [1] # The range of random integers is [low, high] - word = fluid.create_random_lodtensor( + word = fluid.create_random_int_lodtensor( lod, base_shape, place, low=0, high=WORD_DICT_LEN - 1) - pred = fluid.create_random_lodtensor( + pred = fluid.create_random_int_lodtensor( lod, base_shape, place, low=0, high=PRED_DICT_LEN - 1) - ctx_n2 = fluid.create_random_lodtensor( + ctx_n2 = fluid.create_random_int_lodtensor( lod, base_shape, place, low=0, high=WORD_DICT_LEN - 1) - ctx_n1 = fluid.create_random_lodtensor( + ctx_n1 = fluid.create_random_int_lodtensor( lod, base_shape, place, low=0, high=WORD_DICT_LEN - 1) - ctx_0 = fluid.create_random_lodtensor( + ctx_0 = fluid.create_random_int_lodtensor( lod, base_shape, place, low=0, high=WORD_DICT_LEN - 1) - ctx_p1 = fluid.create_random_lodtensor( + ctx_p1 = fluid.create_random_int_lodtensor( lod, base_shape, place, low=0, high=WORD_DICT_LEN - 1) - ctx_p2 = fluid.create_random_lodtensor( + ctx_p2 = fluid.create_random_int_lodtensor( lod, base_shape, place, low=0, high=WORD_DICT_LEN - 1) - mark = fluid.create_random_lodtensor( + mark = fluid.create_random_int_lodtensor( lod, base_shape, place, low=0, high=MARK_DICT_LEN - 1) results = inferencer.infer( diff --git a/python/paddle/fluid/tests/book/test_label_semantic_roles.py b/python/paddle/fluid/tests/book/test_label_semantic_roles.py index 21839e588f..bc8a1aafc8 100644 --- a/python/paddle/fluid/tests/book/test_label_semantic_roles.py +++ b/python/paddle/fluid/tests/book/test_label_semantic_roles.py @@ -261,21 +261,21 @@ def infer(use_cuda, save_dirname=None): lod = [[3, 4, 2]] base_shape = [1] # The range of random integers is [low, high] - word = fluid.create_random_lodtensor( + word = fluid.create_random_int_lodtensor( lod, base_shape, place, low=0, high=word_dict_len - 1) - pred = fluid.create_random_lodtensor( + pred = fluid.create_random_int_lodtensor( lod, base_shape, place, low=0, high=pred_dict_len - 1) - ctx_n2 = fluid.create_random_lodtensor( + ctx_n2 = fluid.create_random_int_lodtensor( lod, base_shape, place, low=0, high=word_dict_len - 1) - ctx_n1 = fluid.create_random_lodtensor( + ctx_n1 = fluid.create_random_int_lodtensor( lod, base_shape, place, low=0, high=word_dict_len - 1) - ctx_0 = fluid.create_random_lodtensor( + ctx_0 = fluid.create_random_int_lodtensor( lod, base_shape, place, low=0, high=word_dict_len - 1) - ctx_p1 = fluid.create_random_lodtensor( + ctx_p1 = fluid.create_random_int_lodtensor( lod, base_shape, place, low=0, high=word_dict_len - 1) - ctx_p2 = fluid.create_random_lodtensor( + ctx_p2 = fluid.create_random_int_lodtensor( lod, base_shape, place, low=0, high=word_dict_len - 1) - mark = fluid.create_random_lodtensor( + mark = fluid.create_random_int_lodtensor( lod, base_shape, place, low=0, high=mark_dict_len - 1) # Construct feed as a dictionary of {feed_target_name: feed_target_data} -- GitLab