From 8cce33043088ebcbca63c375f6fb7146d1cbeca1 Mon Sep 17 00:00:00 2001 From: Kexin Zhao Date: Wed, 23 May 2018 17:55:15 -0700 Subject: [PATCH] fix error --- .../understand_sentiment/test_understand_sentiment_conv.py | 2 +- .../test_understand_sentiment_dynamic_rnn.py | 2 +- .../test_understand_sentiment_stacked_lstm.py | 2 +- python/paddle/fluid/tests/book/notest_understand_sentiment.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/python/paddle/fluid/tests/book/high-level-api/understand_sentiment/test_understand_sentiment_conv.py b/python/paddle/fluid/tests/book/high-level-api/understand_sentiment/test_understand_sentiment_conv.py index 6e10a8a669e..7e32696f990 100644 --- a/python/paddle/fluid/tests/book/high-level-api/understand_sentiment/test_understand_sentiment_conv.py +++ b/python/paddle/fluid/tests/book/high-level-api/understand_sentiment/test_understand_sentiment_conv.py @@ -134,7 +134,7 @@ def infer(use_cuda, inference_program, save_dirname=None): lod = [[3, 4, 2]] base_shape = [1] # The range of random integers is [low, high] - tensor_words = fluid.create_random_lodtensor( + tensor_words = fluid.create_random_int_lodtensor( lod, base_shape, place, low=0, high=len(word_dict) - 1) results = inferencer.infer({'words': tensor_words}) print("infer results: ", results) diff --git a/python/paddle/fluid/tests/book/high-level-api/understand_sentiment/test_understand_sentiment_dynamic_rnn.py b/python/paddle/fluid/tests/book/high-level-api/understand_sentiment/test_understand_sentiment_dynamic_rnn.py index acb569d9f6d..e50b7920b17 100644 --- a/python/paddle/fluid/tests/book/high-level-api/understand_sentiment/test_understand_sentiment_dynamic_rnn.py +++ b/python/paddle/fluid/tests/book/high-level-api/understand_sentiment/test_understand_sentiment_dynamic_rnn.py @@ -149,7 +149,7 @@ def infer(use_cuda, inference_program, save_dirname=None): lod = [[3, 4, 2]] base_shape = [1] # The range of random integers is [low, high] - tensor_words = fluid.create_random_lodtensor( + tensor_words = fluid.create_random_int_lodtensor( lod, base_shape, place, low=0, high=len(word_dict) - 1) results = inferencer.infer({'words': tensor_words}) print("infer results: ", results) diff --git a/python/paddle/fluid/tests/book/high-level-api/understand_sentiment/test_understand_sentiment_stacked_lstm.py b/python/paddle/fluid/tests/book/high-level-api/understand_sentiment/test_understand_sentiment_stacked_lstm.py index c92ef2a30b8..d4fb8016881 100644 --- a/python/paddle/fluid/tests/book/high-level-api/understand_sentiment/test_understand_sentiment_stacked_lstm.py +++ b/python/paddle/fluid/tests/book/high-level-api/understand_sentiment/test_understand_sentiment_stacked_lstm.py @@ -141,7 +141,7 @@ def infer(use_cuda, inference_program, save_dirname=None): lod = [[3, 4, 2]] base_shape = [1] # The range of random integers is [low, high] - tensor_words = fluid.create_random_lodtensor( + tensor_words = fluid.create_random_int_lodtensor( lod, base_shape, place, low=0, high=len(word_dict) - 1) results = inferencer.infer({'words': tensor_words}) print("infer results: ", results) diff --git a/python/paddle/fluid/tests/book/notest_understand_sentiment.py b/python/paddle/fluid/tests/book/notest_understand_sentiment.py index beebc15774d..c6687e8ad7f 100644 --- a/python/paddle/fluid/tests/book/notest_understand_sentiment.py +++ b/python/paddle/fluid/tests/book/notest_understand_sentiment.py @@ -247,7 +247,7 @@ def infer(word_dict, use_cuda, save_dirname=None): lod = [[3, 4, 2]] base_shape = [1] # The range of random integers is [low, high] - tensor_words = fluid.create_random_lodtensor( + tensor_words = fluid.create_random_int_lodtensor( lod, base_shape, place, low=0, high=word_dict_len - 1) # Construct feed as a dictionary of {feed_target_name: feed_target_data} -- GitLab