Skip to content

Commit

Permalink
Update documentation for mxnet.ndarray.GridGenerator. (apache#6430)
Browse files Browse the repository at this point in the history
* Update documentation for mxnet.ndarray.GridGenerator.

Thanks @Lyken17 for apache#6147

* Fix lint error.

* Minor fix.

* Remove the example.
  • Loading branch information
indhub authored and Olivier committed May 30, 2017
1 parent 9d3db06 commit 75d5107
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
10 changes: 5 additions & 5 deletions src/operator/grid_generator-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ struct GridGeneratorParam : public dmlc::Parameter<GridGeneratorParam> {
DMLC_DECLARE_FIELD(transform_type)
.add_enum("affine", grid::kAffine)
.add_enum("warp", grid::kWarp)
.describe("transformation type\n "
"if transformation type is affine, data is affine matrix : (batch, 6)\n "
"if transformation type is warp, data is optical flow : (batch, 2, h, w)");
.describe("The type of transformation. For `affine`, input data should be an affine matrix "
"of size (batch, 6). For `warp`, input data should be an optical flow of size "
"(batch, 2, h, w).");
DMLC_DECLARE_FIELD(target_shape).set_default(TShape(shape, shape + 2))
.describe("if transformation type is affine, the operator need a target_shape : (H, W)\n "
"if transofrmation type is warp, the operator will ignore target_shape");
.describe("Specifies the output shape (H, W). This is required if transformation type is "
"`affine`. If transformation type is `warp`, this parameter is ignored.");
}
};

Expand Down
6 changes: 2 additions & 4 deletions src/operator/grid_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,9 @@ Operator *GridGeneratorProp::CreateOperatorEx(Context ctx, std::vector<TShape> *
DMLC_REGISTER_PARAMETER(GridGeneratorParam);

MXNET_REGISTER_OP_PROPERTY(GridGenerator, GridGeneratorProp)
.add_argument("data", "NDArray-or-Symbol", "Input data to the GridGeneratorOp.")
.describe("if transformation type is affine, data is affine matrix : (batch, 6)")
.describe("if transformation type is warp, data is optical flow : (batch, 2, h, w)")
.add_argument("data", "NDArray-or-Symbol", "Input data to the function.")
.add_arguments(GridGeneratorParam::__FIELDS__())
.describe("Generates sampling grid for bilinear sampling.");
.describe("Generates 2D sampling grid for bilinear sampling.");

} // namespace op
} // namespace mxnet

0 comments on commit 75d5107

Please sign in to comment.