From f4d5d3d51664a861350765a1d6de8c0b7ae430b7 Mon Sep 17 00:00:00 2001 From: Lin Yuan Date: Tue, 23 Oct 2018 16:04:58 -0700 Subject: [PATCH 1/4] Fix the operator API documentation --- src/operator/contrib/multibox_target-inl.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/operator/contrib/multibox_target-inl.h b/src/operator/contrib/multibox_target-inl.h index f5a3b1189d19..33d2b605e818 100644 --- a/src/operator/contrib/multibox_target-inl.h +++ b/src/operator/contrib/multibox_target-inl.h @@ -220,13 +220,13 @@ class MultiBoxTargetProp : public OperatorProperty { CHECK_EQ(ashape.ndim(), 3) << "Anchor should be batch shared N*4 tensor"; CHECK_EQ(ashape[0], 1) << "Anchors are shared across batches, first dim=1"; CHECK_GT(ashape[1], 0) << "Number boxes should > 0"; - CHECK_EQ(ashape[2], 4) << "Box dimension should be 4: [xmin-ymin-xmax-ymax]"; + CHECK_EQ(ashape[2], 4) << "Box dimension should be 4: [xmin, ymin, xmax, ymax]"; TShape lshape = in_shape->at(mboxtarget_enum::kLabel); - CHECK_EQ(lshape.ndim(), 3) << "Label should be [batch-num_labels-(>=5)] tensor"; - CHECK_GT(lshape[1], 0) << "Padded label should > 0"; - CHECK_GE(lshape[2], 5) << "Label width must >=5"; + CHECK_EQ(lshape.ndim(), 3) << "Label should be [batch, num_labels, label_width] tensor"; + CHECK_GT(lshape[1], 0) << "Padded label should be greater than 0"; + CHECK_GE(lshape[2], 5) << "Label width should be greater than or equal 5"; TShape pshape = in_shape->at(mboxtarget_enum::kClsPred); - CHECK_EQ(pshape.ndim(), 3) << "Prediction: [nbatch-num_classes-num_anchors]"; + CHECK_EQ(pshape.ndim(), 3) << "Prediction: [batch, num_classes, num_anchors]"; CHECK_EQ(pshape[2], ashape[1]) << "Number of anchors mismatch"; TShape loc_shape = Shape2(lshape[0], ashape.Size()); // batch - (num_box * 4) TShape lm_shape = loc_shape; From cf91cf7a9a6ca40b503aad7d01426cf0873c93ba Mon Sep 17 00:00:00 2001 From: Lin Yuan Date: Tue, 23 Oct 2018 16:26:01 -0700 Subject: [PATCH 2/4] update message --- src/operator/contrib/multibox_target-inl.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/operator/contrib/multibox_target-inl.h b/src/operator/contrib/multibox_target-inl.h index 33d2b605e818..daf870a1517a 100644 --- a/src/operator/contrib/multibox_target-inl.h +++ b/src/operator/contrib/multibox_target-inl.h @@ -218,13 +218,13 @@ class MultiBoxTargetProp : public OperatorProperty { CHECK_EQ(in_shape->size(), 3) << "Input: [anchor, label, clsPred]"; TShape ashape = in_shape->at(mboxtarget_enum::kAnchor); CHECK_EQ(ashape.ndim(), 3) << "Anchor should be batch shared N*4 tensor"; - CHECK_EQ(ashape[0], 1) << "Anchors are shared across batches, first dim=1"; - CHECK_GT(ashape[1], 0) << "Number boxes should > 0"; + CHECK_EQ(ashape[0], 1) << "Anchors are shared across batches, first dimension should be 1"; + CHECK_GT(ashape[1], 0) << "Number boxes should be greater than 0"; CHECK_EQ(ashape[2], 4) << "Box dimension should be 4: [xmin, ymin, xmax, ymax]"; TShape lshape = in_shape->at(mboxtarget_enum::kLabel); CHECK_EQ(lshape.ndim(), 3) << "Label should be [batch, num_labels, label_width] tensor"; CHECK_GT(lshape[1], 0) << "Padded label should be greater than 0"; - CHECK_GE(lshape[2], 5) << "Label width should be greater than or equal 5"; + CHECK_GE(lshape[2], 5) << "Label width should be greater than or equal to 5"; TShape pshape = in_shape->at(mboxtarget_enum::kClsPred); CHECK_EQ(pshape.ndim(), 3) << "Prediction: [batch, num_classes, num_anchors]"; CHECK_EQ(pshape[2], ashape[1]) << "Number of anchors mismatch"; From 1e56db1b88362c50d20d2a14347ac1ae987444ab Mon Sep 17 00:00:00 2001 From: Lin Yuan Date: Tue, 30 Oct 2018 12:18:27 -0700 Subject: [PATCH 3/4] deprecate old command --- src/operator/nn/ctc_loss.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/operator/nn/ctc_loss.cc b/src/operator/nn/ctc_loss.cc index c381677b3ce0..d9c7606f2e28 100644 --- a/src/operator/nn/ctc_loss.cc +++ b/src/operator/nn/ctc_loss.cc @@ -53,6 +53,9 @@ NNVM_REGISTER_OP(CTCLoss) .add_alias("_contrib_CTCLoss") .add_alias("_contrib_ctc_loss") .describe(R"code(Connectionist Temporal Classification Loss. + +.. note:: The existing alias ``contrib_CTCLoss`` is deprecated. + The shapes of the inputs and outputs: - **data**: `(sequence_length, batch_size, alphabet_size)` From 091ccabb2147fbe1a5dad29a2e6a41b811fe010d Mon Sep 17 00:00:00 2001 From: Lin Yuan Date: Mon, 5 Nov 2018 09:33:31 -0800 Subject: [PATCH 4/4] fix typo in op guide --- docs/faq/add_op_in_backend.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/faq/add_op_in_backend.md b/docs/faq/add_op_in_backend.md index 2fcc678b8ca0..ed906da27377 100644 --- a/docs/faq/add_op_in_backend.md +++ b/docs/faq/add_op_in_backend.md @@ -489,9 +489,9 @@ in the computational graph. MXNet would add the missing argument with name `quadratic0_data`, where the prefix `quadratic0` is the operator name appended with an index and the postfix `data` comes from the return value of the user defined `FListInputName` function. -Users still can generate an executor for the `quand_func` like the following: +Users still can generate an executor for the `quad_func` like the following: ```python -quand_exe = quand_func.simple_bind(ctx=mx.cpu(), quandratic0_data=(1,)) +quad_exe = quad_func.simple_bind(ctx=mx.cpu(), quadratic0_data=(1,)) ``` - Line 12: Register shape inference function. - Line 13: Register type inference function.