Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
… argmin_argmax
  • Loading branch information
sneaxiy committed Jun 19, 2018
2 parents fa002cd + a29cb4b commit 5c9dcc4
Show file tree
Hide file tree
Showing 180 changed files with 5,350 additions and 3,020 deletions.
1 change: 1 addition & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
| jczaja | Jacek Czaja |
| JiayiFeng | Jia-Yi Feng |
| kbinias | Krzysztof Binias |
| kexinzhao | Ke-Xin Zhao |
| kuke | Yi-Bing Liu |
| lcy-seso | Ying Cao |
| lipeng-unisound | Peng Li |
Expand Down
15 changes: 0 additions & 15 deletions benchmark/fluid/models/machine_translation.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,21 +173,6 @@ def simple_attention(encoder_vec, encoder_proj, decoder_state):
return avg_cost, feeding_list


def to_lodtensor(data, place):
seq_lens = [len(seq) for seq in data]
cur_len = 0
lod = [cur_len]
for l in seq_lens:
cur_len += l
lod.append(cur_len)
flattened_data = np.concatenate(data, axis=0).astype("int64")
flattened_data = flattened_data.reshape([len(flattened_data), 1])
lod_t = core.LoDTensor()
lod_t.set(flattened_data, place)
lod_t.set_lod([lod])
return lod_t, lod[-1]


def lodtensor_to_ndarray(lod_tensor):
dims = lod_tensor.get_dims()
ndarray = np.zeros(shape=dims).astype('float32')
Expand Down
15 changes: 0 additions & 15 deletions benchmark/fluid/models/stacked_dynamic_lstm.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,18 +125,3 @@ def gate_common(
batch_size=args.batch_size)

return loss, inference_program, adam, train_reader, test_reader, batch_acc


def to_lodtensor(data, place):
seq_lens = [len(seq) for seq in data]
cur_len = 0
lod = [cur_len]
for l in seq_lens:
cur_len += l
lod.append(cur_len)
flattened_data = numpy.concatenate(data, axis=0).astype("int64")
flattened_data = flattened_data.reshape([len(flattened_data), 1])
res = fluid.LoDTensor()
res.set(flattened_data, place)
res.set_lod([lod])
return res
11 changes: 10 additions & 1 deletion cmake/inference_lib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function(copy TARGET)
message(FATAL_ERROR "${TARGET} source numbers are not equal to destination numbers")
endif()
math(EXPR len "${copy_lib_SRCS_len} - 1")

add_custom_target(${TARGET} DEPENDS ${copy_lib_DEPS})
foreach(index RANGE ${len})
list(GET copy_lib_SRCS ${index} src)
Expand Down Expand Up @@ -155,6 +155,15 @@ copy(inference_lib DEPS paddle_fluid_shared paddle_fluid
DSTS ${dst_dir}/${module} ${dst_dir}/${module}
)

if(WITH_CONTRIB)
set(contrib_dst_dir "${FLUID_INSTALL_DIR}/contrib/inference")
copy(contrib_inference_lib DEPS paddle_inference_api
SRCS ${PADDLE_SOURCE_DIR}/paddle/contrib/inference/paddle_inference_api.h
${PADDLE_BINARY_DIR}/paddle/contrib/inference/libpaddle_inference_api.*
DSTS ${contrib_dst_dir} ${contrib_dst_dir}
)
endif()

set(module "platform")
copy(platform_lib DEPS profiler_py_proto
SRCS ${src_dir}/${module}/*.h ${src_dir}/${module}/dynload/*.h ${src_dir}/${module}/details/*.h
Expand Down
2 changes: 1 addition & 1 deletion doc/fluid/api/gen_doc.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
python gen_doc.py layers --submodules control_flow device io nn ops tensor detection learning_rate_scheduler > layers.rst
python gen_doc.py layers --submodules control_flow device io nn ops tensor detection learning_rate_scheduler metric > layers.rst

for module in data_feeder clip metrics executor initializer io nets optimizer param_attr profiler regularizer
do
Expand Down
14 changes: 14 additions & 0 deletions doc/fluid/api/initializer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ Xavier
:members:
:noindex:

Bilinear
--------

.. autoclass:: paddle.fluid.initializer.Bilinear
:members:
:noindex:

force_init_on_cpu
-----------------

Expand Down Expand Up @@ -73,3 +80,10 @@ XavierInitializer
:members:
:noindex:

BilinearInitializer
-------------------

.. autoclass:: paddle.fluid.initializer.BilinearInitializer
:members:
:noindex:

36 changes: 36 additions & 0 deletions doc/fluid/api/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,39 @@ get_inference_program
.. autofunction:: paddle.fluid.io.get_inference_program
:noindex:

save_checkpoint
---------------

.. autofunction:: paddle.fluid.io.save_checkpoint
:noindex:

load_checkpoint
---------------

.. autofunction:: paddle.fluid.io.load_checkpoint
:noindex:

clean_checkpoint
----------------

.. autofunction:: paddle.fluid.io.clean_checkpoint
:noindex:

load_persist_vars_without_grad
------------------------------

.. autofunction:: paddle.fluid.io.load_persist_vars_without_grad
:noindex:

save_persist_vars_without_grad
------------------------------

.. autofunction:: paddle.fluid.io.save_persist_vars_without_grad
:noindex:

get_latest_checkpoint_serial
----------------------------

.. autofunction:: paddle.fluid.io.get_latest_checkpoint_serial
:noindex:

Loading

0 comments on commit 5c9dcc4

Please sign in to comment.