提交 8cce3304 编写于 作者: K Kexin Zhao

fix error

上级 5a10d833
...@@ -134,7 +134,7 @@ def infer(use_cuda, inference_program, save_dirname=None): ...@@ -134,7 +134,7 @@ def infer(use_cuda, inference_program, save_dirname=None):
lod = [[3, 4, 2]] lod = [[3, 4, 2]]
base_shape = [1] base_shape = [1]
# The range of random integers is [low, high] # 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) lod, base_shape, place, low=0, high=len(word_dict) - 1)
results = inferencer.infer({'words': tensor_words}) results = inferencer.infer({'words': tensor_words})
print("infer results: ", results) print("infer results: ", results)
......
...@@ -149,7 +149,7 @@ def infer(use_cuda, inference_program, save_dirname=None): ...@@ -149,7 +149,7 @@ def infer(use_cuda, inference_program, save_dirname=None):
lod = [[3, 4, 2]] lod = [[3, 4, 2]]
base_shape = [1] base_shape = [1]
# The range of random integers is [low, high] # 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) lod, base_shape, place, low=0, high=len(word_dict) - 1)
results = inferencer.infer({'words': tensor_words}) results = inferencer.infer({'words': tensor_words})
print("infer results: ", results) print("infer results: ", results)
......
...@@ -141,7 +141,7 @@ def infer(use_cuda, inference_program, save_dirname=None): ...@@ -141,7 +141,7 @@ def infer(use_cuda, inference_program, save_dirname=None):
lod = [[3, 4, 2]] lod = [[3, 4, 2]]
base_shape = [1] base_shape = [1]
# The range of random integers is [low, high] # 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) lod, base_shape, place, low=0, high=len(word_dict) - 1)
results = inferencer.infer({'words': tensor_words}) results = inferencer.infer({'words': tensor_words})
print("infer results: ", results) print("infer results: ", results)
......
...@@ -247,7 +247,7 @@ def infer(word_dict, use_cuda, save_dirname=None): ...@@ -247,7 +247,7 @@ def infer(word_dict, use_cuda, save_dirname=None):
lod = [[3, 4, 2]] lod = [[3, 4, 2]]
base_shape = [1] base_shape = [1]
# The range of random integers is [low, high] # 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) lod, base_shape, place, low=0, high=word_dict_len - 1)
# Construct feed as a dictionary of {feed_target_name: feed_target_data} # Construct feed as a dictionary of {feed_target_name: feed_target_data}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册