Skip to content

Commit 62bad2b

Browse files
committed
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into pr/11489
2 parents f24dec7 + 20e5ef6 commit 62bad2b

File tree

116 files changed

+3400
-1438
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+3400
-1438
lines changed

AUTHORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
| jczaja | Jacek Czaja |
2323
| JiayiFeng | Jia-Yi Feng |
2424
| kbinias | Krzysztof Binias |
25+
| kexinzhao | Ke-Xin Zhao |
2526
| kuke | Yi-Bing Liu |
2627
| lcy-seso | Ying Cao |
2728
| lipeng-unisound | Peng Li |

benchmark/fluid/models/machine_translation.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -173,21 +173,6 @@ def simple_attention(encoder_vec, encoder_proj, decoder_state):
173173
return avg_cost, feeding_list
174174

175175

176-
def to_lodtensor(data, place):
177-
seq_lens = [len(seq) for seq in data]
178-
cur_len = 0
179-
lod = [cur_len]
180-
for l in seq_lens:
181-
cur_len += l
182-
lod.append(cur_len)
183-
flattened_data = np.concatenate(data, axis=0).astype("int64")
184-
flattened_data = flattened_data.reshape([len(flattened_data), 1])
185-
lod_t = core.LoDTensor()
186-
lod_t.set(flattened_data, place)
187-
lod_t.set_lod([lod])
188-
return lod_t, lod[-1]
189-
190-
191176
def lodtensor_to_ndarray(lod_tensor):
192177
dims = lod_tensor.get_dims()
193178
ndarray = np.zeros(shape=dims).astype('float32')

benchmark/fluid/models/stacked_dynamic_lstm.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -125,18 +125,3 @@ def gate_common(
125125
batch_size=args.batch_size)
126126

127127
return loss, inference_program, adam, train_reader, test_reader, batch_acc
128-
129-
130-
def to_lodtensor(data, place):
131-
seq_lens = [len(seq) for seq in data]
132-
cur_len = 0
133-
lod = [cur_len]
134-
for l in seq_lens:
135-
cur_len += l
136-
lod.append(cur_len)
137-
flattened_data = numpy.concatenate(data, axis=0).astype("int64")
138-
flattened_data = flattened_data.reshape([len(flattened_data), 1])
139-
res = fluid.LoDTensor()
140-
res.set(flattened_data, place)
141-
res.set_lod([lod])
142-
return res

cmake/inference_lib.cmake

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function(copy TARGET)
3939
message(FATAL_ERROR "${TARGET} source numbers are not equal to destination numbers")
4040
endif()
4141
math(EXPR len "${copy_lib_SRCS_len} - 1")
42-
42+
4343
add_custom_target(${TARGET} DEPENDS ${copy_lib_DEPS})
4444
foreach(index RANGE ${len})
4545
list(GET copy_lib_SRCS ${index} src)
@@ -155,6 +155,15 @@ copy(inference_lib DEPS paddle_fluid_shared paddle_fluid
155155
DSTS ${dst_dir}/${module} ${dst_dir}/${module}
156156
)
157157

158+
if(WITH_CONTRIB)
159+
set(contrib_dst_dir "${FLUID_INSTALL_DIR}/contrib/inference")
160+
copy(contrib_inference_lib DEPS paddle_inference_api
161+
SRCS ${PADDLE_SOURCE_DIR}/paddle/contrib/inference/paddle_inference_api.h
162+
${PADDLE_BINARY_DIR}/paddle/contrib/inference/libpaddle_inference_api.*
163+
DSTS ${contrib_dst_dir} ${contrib_dst_dir}
164+
)
165+
endif()
166+
158167
set(module "platform")
159168
copy(platform_lib DEPS profiler_py_proto
160169
SRCS ${src_dir}/${module}/*.h ${src_dir}/${module}/dynload/*.h ${src_dir}/${module}/details/*.h

doc/fluid/api/gen_doc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
python gen_doc.py layers --submodules control_flow device io nn ops tensor detection learning_rate_scheduler > layers.rst
2+
python gen_doc.py layers --submodules control_flow device io nn ops tensor detection learning_rate_scheduler metric > layers.rst
33

44
for module in data_feeder clip metrics executor initializer io nets optimizer param_attr profiler regularizer
55
do

doc/fluid/api/initializer.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ Xavier
3333
:members:
3434
:noindex:
3535

36+
Bilinear
37+
--------
38+
39+
.. autoclass:: paddle.fluid.initializer.Bilinear
40+
:members:
41+
:noindex:
42+
3643
force_init_on_cpu
3744
-----------------
3845

@@ -73,3 +80,10 @@ XavierInitializer
7380
:members:
7481
:noindex:
7582

83+
BilinearInitializer
84+
-------------------
85+
86+
.. autoclass:: paddle.fluid.initializer.BilinearInitializer
87+
:members:
88+
:noindex:
89+

doc/fluid/api/io.rst

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,39 @@ get_inference_program
5959
.. autofunction:: paddle.fluid.io.get_inference_program
6060
:noindex:
6161

62+
save_checkpoint
63+
---------------
64+
65+
.. autofunction:: paddle.fluid.io.save_checkpoint
66+
:noindex:
67+
68+
load_checkpoint
69+
---------------
70+
71+
.. autofunction:: paddle.fluid.io.load_checkpoint
72+
:noindex:
73+
74+
clean_checkpoint
75+
----------------
76+
77+
.. autofunction:: paddle.fluid.io.clean_checkpoint
78+
:noindex:
79+
80+
load_persist_vars_without_grad
81+
------------------------------
82+
83+
.. autofunction:: paddle.fluid.io.load_persist_vars_without_grad
84+
:noindex:
85+
86+
save_persist_vars_without_grad
87+
------------------------------
88+
89+
.. autofunction:: paddle.fluid.io.save_persist_vars_without_grad
90+
:noindex:
91+
92+
get_latest_checkpoint_serial
93+
----------------------------
94+
95+
.. autofunction:: paddle.fluid.io.get_latest_checkpoint_serial
96+
:noindex:
97+

0 commit comments

Comments
 (0)