From 75d5107417e68b05abd103b72303fe9ff08a2667 Mon Sep 17 00:00:00 2001 From: Indhu Bharathi Date: Thu, 25 May 2017 15:28:56 -0700 Subject: [PATCH] Update documentation for mxnet.ndarray.GridGenerator. (#6430) * Update documentation for mxnet.ndarray.GridGenerator. Thanks @Lyken17 for https://github.com/dmlc/mxnet/issues/6147 * Fix lint error. * Minor fix. * Remove the example. --- src/operator/grid_generator-inl.h | 10 +++++----- src/operator/grid_generator.cc | 6 ++---- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/operator/grid_generator-inl.h b/src/operator/grid_generator-inl.h index 1f88cf4935da..04fe7ec1c5fd 100644 --- a/src/operator/grid_generator-inl.h +++ b/src/operator/grid_generator-inl.h @@ -36,12 +36,12 @@ struct GridGeneratorParam : public dmlc::Parameter { 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."); } }; diff --git a/src/operator/grid_generator.cc b/src/operator/grid_generator.cc index 831e8a359493..8625d1ba971a 100644 --- a/src/operator/grid_generator.cc +++ b/src/operator/grid_generator.cc @@ -32,11 +32,9 @@ Operator *GridGeneratorProp::CreateOperatorEx(Context ctx, std::vector * 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