Skip to content

Commit fbddb8e

Browse files
author
Yibing Liu
committed
Merge branch 'develop' of upstream into fix_docs
2 parents 0b063e5 + 34ac0eb commit fbddb8e

28 files changed

+1145
-300
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 |

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/layers.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,12 @@ conv2d
342342
.. autofunction:: paddle.fluid.layers.conv2d
343343
:noindex:
344344

345+
conv3d
346+
------
347+
348+
.. autofunction:: paddle.fluid.layers.conv3d
349+
:noindex:
350+
345351
sequence_pool
346352
-------------
347353

@@ -366,6 +372,12 @@ pool2d
366372
.. autofunction:: paddle.fluid.layers.pool2d
367373
:noindex:
368374

375+
pool3d
376+
------
377+
378+
.. autofunction:: paddle.fluid.layers.pool3d
379+
:noindex:
380+
369381
batch_norm
370382
----------
371383

@@ -384,6 +396,13 @@ conv2d_transpose
384396
.. autofunction:: paddle.fluid.layers.conv2d_transpose
385397
:noindex:
386398

399+
conv3d_transpose
400+
----------------
401+
402+
.. autofunction:: paddle.fluid.layers.conv2d_transpose
403+
:noindex:
404+
405+
387406
sequence_expand
388407
---------------
389408

doc/v2/dev/contribute_to_paddle_cn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ no changes added to commit (use "git add" and/or "git commit -a")
104104
➜ docker run -it -v $(pwd):/paddle paddle:latest-dev bash -c "cd /paddle/build && ctest"
105105
```
106106

107-
关于构建和测试的更多信息,请参见[这篇文档](https://github.com/PaddlePaddle/Paddle/blob/develop/doc/getstarted/build_and_install/docker_install_cn.rst)
107+
关于构建和测试的更多信息,请参见[使用Docker安装运行](https://github.com/PaddlePaddle/Paddle/blob/develop/doc/v2/build_and_install/docker_install_cn.rst)
108108

109109
## 提交(commit)
110110

paddle/contrib/inference/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ cc_test(test_paddle_inference_api
5050
inference_api_test(test_paddle_inference_api_impl
5151
ARGS test_word2vec test_image_classification)
5252

53-
if (WITH_ANAKIN)
53+
if (WITH_ANAKIN AND WITH_TESTING) # only needed in CI
5454
# Due to Anakin do not have official library releases and the versions of protobuf and cuda do not match Paddle's,
5555
# so anakin library will not be merged to our official inference library. To use anakin prediction API, one need to
5656
# compile the libinference_anakin_api.a and compile with anakin.so.

paddle/contrib/tape/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ if(APPLE)
1717
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=pessimizing-move")
1818
endif(APPLE)
1919

20-
cc_library(tape_variable SRCS variable.cc DEPS ${FLUID_CORE_MODULES} device_context)
20+
cc_library(tape_variable SRCS variable.cc DEPS ${FLUID_CORE_MODULES} device_context framework_proto proto_desc operator)
2121
cc_library(tape SRCS tape.cc DEPS ${FLUID_CORE_MODULES} ${GLOB_OP_LIB} tape_variable)
2222

2323
cc_test(test_tape

paddle/fluid/operators/activation_op.cc

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -271,18 +271,18 @@ class HardShrinkOpMaker : public framework::OpProtoAndCheckerMaker {
271271
void Make() override {
272272
AddInput("X", "Input of HardShrink operator");
273273
AddOutput("Out", "Output of HardShrink operator");
274-
AddAttr<float>("threshold", "The value of threshold for HardShrink")
274+
AddAttr<float>("threshold",
275+
"The value of threshold for HardShrink. [default: 0.5]")
275276
.SetDefault(0.5f);
276277
AddComment(R"DOC(
277-
HardShrink Activation Operator.
278+
:strong:`HardShrink activation operator`
278279
279-
$$
280-
out = \begin{cases}
281-
x, \text{if } x > \lambda \\
282-
x, \text{if } x < -\lambda \\
283-
0, \text{otherwise}
284-
\end{cases}
285-
$$
280+
.. math::
281+
out = \begin{cases}
282+
x, \text{if } x > \lambda \\
283+
x, \text{if } x < -\lambda \\
284+
0, \text{otherwise}
285+
\end{cases}
286286
287287
)DOC");
288288
}
@@ -394,18 +394,18 @@ class ThresholdedReluOpMaker : public framework::OpProtoAndCheckerMaker {
394394
void Make() override {
395395
AddInput("X", "Input of ThresholdedRelu operator");
396396
AddOutput("Out", "Output of ThresholdedRelu operator");
397-
AddAttr<float>("threshold", "The threshold location of activation")
397+
AddAttr<float>("threshold",
398+
"The threshold location of activation. [default 1.0].")
398399
.SetDefault(1.0f);
399400
AddComment(R"DOC(
400-
ThresholdedRelu Activation Operator.
401+
:strong:`ThresholdedRelu activation operator`
401402
402-
$$
403-
out = \begin{cases}
404-
x, \text{if } x > threshold \\
405-
0, \text{otherwise}
406-
\end{cases}
407-
$$
403+
.. math::
408404
405+
out = \begin{cases}
406+
x, \text{if } x > threshold \\
407+
0, \text{otherwise}
408+
\end{cases}
409409
)DOC");
410410
}
411411
};

paddle/fluid/operators/compare_op.cc

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,30 +23,26 @@ class CompareOpProtoMaker : public framework::OpProtoAndCheckerMaker {
2323
public:
2424
void Make() override {
2525
OpComment comment;
26-
AddInput("X",
27-
string::Sprintf("(LoDTensor) the left hand operand of %s operator",
28-
comment.type));
29-
AddInput("Y", string::Sprintf(
30-
"(LoDTensor) the right hand operand of %s operator",
31-
comment.type));
26+
AddInput("X", string::Sprintf("the left hand operand of %s operator",
27+
comment.type));
28+
AddInput("Y", string::Sprintf("the right hand operand of %s operator",
29+
comment.type));
3230
AddAttr<bool>("force_cpu",
33-
"(bool, default false) Force fill output variable to cpu "
31+
"Force fill output variable to cpu "
3432
"memory. Otherwise, fill output variable to the running "
35-
"device")
36-
.SetDefault(false);
37-
AddOutput("Out", string::Sprintf(
38-
"(LoDTensor) n-dim bool tensor. Each element is %s",
39-
comment.equation));
40-
AddComment(string::Sprintf(R"DOC(%s Operator
41-
33+
"device [default true].")
34+
.SetDefault(true);
35+
AddOutput("Out", string::Sprintf("n-dim bool tensor. Each element is %s",
36+
comment.equation));
37+
AddComment(string::Sprintf(R"DOC(
4238
It operates element-wise on X and Y, and returns the Out. Each of them is a
4339
N-dim tensor. X and Y could be any type. The each element of the Out tensor is
44-
calculated by %s
40+
calculated by $%s$
4541
)DOC",
46-
comment.type, comment.equation));
47-
AddAttr<int>("axis",
48-
"(int, default -1). The start dimension index "
49-
"for broadcasting Y onto X.")
42+
comment.equation));
43+
AddAttr<int>(
44+
"axis",
45+
"The start dimension index for broadcasting Y onto X. [default -1]")
5046
.SetDefault(-1)
5147
.EqualGreaterThan(-1);
5248
}

paddle/fluid/operators/concat_op.cc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,13 @@ REGISTER_OPERATOR(concat, ops::ConcatOp, ops::ConcatOpMaker,
107107
false> /* set false to disable empty grad */);
108108
REGISTER_OPERATOR(concat_grad, ops::ConcatOpGrad);
109109
REGISTER_OP_CPU_KERNEL(
110-
concat, ops::ConcatKernel<paddle::platform::CPUDeviceContext, float>);
110+
concat, ops::ConcatKernel<paddle::platform::CPUDeviceContext, double>,
111+
ops::ConcatKernel<paddle::platform::CPUDeviceContext, float>,
112+
ops::ConcatKernel<paddle::platform::CPUDeviceContext, int64_t>,
113+
ops::ConcatKernel<paddle::platform::CPUDeviceContext, int>);
111114
REGISTER_OP_CPU_KERNEL(
112115
concat_grad,
113-
ops::ConcatGradKernel<paddle::platform::CPUDeviceContext, float>);
116+
ops::ConcatGradKernel<paddle::platform::CPUDeviceContext, double>,
117+
ops::ConcatGradKernel<paddle::platform::CPUDeviceContext, float>,
118+
ops::ConcatGradKernel<paddle::platform::CPUDeviceContext, int64_t>,
119+
ops::ConcatGradKernel<paddle::platform::CPUDeviceContext, int>);

paddle/fluid/operators/concat_op.cu.cc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@ limitations under the License. */
1515
#include "paddle/fluid/operators/concat_op.h"
1616
namespace ops = paddle::operators;
1717
REGISTER_OP_CUDA_KERNEL(
18-
concat, ops::ConcatKernel<paddle::platform::CUDADeviceContext, float>);
18+
concat, ops::ConcatKernel<paddle::platform::CUDADeviceContext, double>,
19+
ops::ConcatKernel<paddle::platform::CUDADeviceContext, float>,
20+
ops::ConcatKernel<paddle::platform::CUDADeviceContext, int64_t>,
21+
ops::ConcatKernel<paddle::platform::CUDADeviceContext, int>);
1922
REGISTER_OP_CUDA_KERNEL(
2023
concat_grad,
21-
ops::ConcatGradKernel<paddle::platform::CUDADeviceContext, float>);
24+
ops::ConcatGradKernel<paddle::platform::CUDADeviceContext, double>,
25+
ops::ConcatGradKernel<paddle::platform::CUDADeviceContext, float>,
26+
ops::ConcatGradKernel<paddle::platform::CUDADeviceContext, int64_t>,
27+
ops::ConcatGradKernel<paddle::platform::CUDADeviceContext, int>);

0 commit comments

Comments
 (0)