From 515e44e5f5fb7b74c334573f2b3f135fa99d5aba Mon Sep 17 00:00:00 2001 From: ying Date: Sat, 23 Dec 2017 19:51:12 +0800 Subject: [PATCH] fix doc. --- paddle/operators/transpose_op.cc | 25 +++++++++++++------------ paddle/operators/unpool_op.cc | 5 ++--- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/paddle/operators/transpose_op.cc b/paddle/operators/transpose_op.cc index 0109b8bc5c3..f18be384345 100644 --- a/paddle/operators/transpose_op.cc +++ b/paddle/operators/transpose_op.cc @@ -70,18 +70,19 @@ class TransposeOpMaker : public framework::OpProtoAndCheckerMaker { Transpose Operator. The input tensor will be permuted according to the axis values given. -The op functions similar to how numpy.transpose works in python. -For example: - >> input = numpy.arange(6).reshape((2,3)) - >> input - array([[0, 1, 2], - [3, 4, 5]]) - >> axis = [1, 0] - >> output = input.transpose(axis) - >> output - array([[0, 3], - [1, 4], - [2, 5]]) +The op functions is similar to how numpy.transpose works in python. + +For example: input = numpy.arange(6).reshape((2,3)) +the input is: +array([[0, 1, 2], + [3, 4, 5]]) +given axis is: [1, 0] + +output = input.transpose(axis) +then the output is: +array([[0, 3], + [1, 4], + [2, 5]]) So, given a input tensor of shape(N, C, H, W) and the axis is {0, 2, 3, 1}, the output tensor shape will be (N, H, W, C) diff --git a/paddle/operators/unpool_op.cc b/paddle/operators/unpool_op.cc index 4ec8efd180d..1b682d5c72b 100644 --- a/paddle/operators/unpool_op.cc +++ b/paddle/operators/unpool_op.cc @@ -53,9 +53,8 @@ class Unpool2dOpMaker : public framework::OpProtoAndCheckerMaker { "(string), unpooling type, can be \"max\" for max-unpooling ") .InEnum({"max"}); AddComment(R"DOC( -"Input shape: $(N, C_{in}, H_{in}, W_{in})$, -Output shape: $(N, C_{out}, H_{out}, W_{out})$ -Where +Input shape is: $(N, C_{in}, H_{in}, W_{in})$, Output shape is: +$(N, C_{out}, H_{out}, W_{out})$, where $$ H_{out} = (H_{in}−1) * strides[0] − 2 * paddings[0] + ksize[0] \\ W_{out} = (W_{in}−1) * strides[1] − 2 * paddings[1] + ksize[1] -- GitLab