wkcn commented on a change in pull request #16017: Add RROIAlign URL: https://github.com/apache/incubator-mxnet/pull/16017#discussion_r318850914
########## File path: src/operator/contrib/rroi_align-inl.h ########## @@ -0,0 +1,67 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/*! + * Copyright (c) 2015 by Contributors + * \file rroi_align-inl.h + * \brief rroi align operator and symbol + * \author Yixin Bao +*/ +#ifndef MXNET_OPERATOR_CONTRIB_RROI_ALIGN_INL_H_ +#define MXNET_OPERATOR_CONTRIB_RROI_ALIGN_INL_H_ + +#include <dmlc/logging.h> +#include <dmlc/parameter.h> +#include <mxnet/operator.h> +#include <map> +#include <vector> +#include <string> +#include <utility> +#include "../mshadow_op.h" +#include "../operator_common.h" + +namespace mxnet { +namespace op { + +// Declare enumeration of input order to make code more intuitive. +// These enums are only visible within this header +namespace rroialign { +enum RROIAlignOpInputs{kData, kBox}; +enum RROIAlignOpOutputs {kOut}; +} // rroialign + +struct RROIAlignParam : public dmlc::Parameter<RROIAlignParam> { + mxnet::TShape pooled_size; + float spatial_scale; + int sampling_ratio; + DMLC_DECLARE_PARAMETER(RROIAlignParam) { + DMLC_DECLARE_FIELD(pooled_size) + .set_expect_ndim(2).enforce_nonzero() + .describe("RROI align output shape (h,w) "); + DMLC_DECLARE_FIELD(spatial_scale).set_range(0.0, 1.0) + .describe("Ratio of input feature map height (or w) to raw image height (or w). " Review comment: It will be better to clarify what is 'or w', and I think it is 'or width'. By the way, the copyright year can be changed to 2019 : ) ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
