text: /*
   * 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) 2017 Microsoft
   * Licensed under The Apache-2.0 License [see LICENSE for details]
   * \file deformable_psroi_pooling.cc
   * \brief
   * \author Yi Li, Guodong Zhang, Jifeng Dai
  */
  #include "./deformable_psroi_pooling_v2-inl.h"
  #include <mshadow/base.h>
  #include <mshadow/tensor.h>
  #include <mshadow/packet-inl.h>
  #include <mshadow/dot_engine-inl.h>
  #include <cassert>
  
  using std::max;
  using std::min;
  using std::floor;
  using std::ceil;
  
  namespace mshadow {
    template<typename DType>
    inline void DeformablePSROIPoolv2Forward(const Tensor<cpu, 4, DType> &out,
      const std::vector<Tensor<cpu, 4, DType>> &datas,
      const Tensor<cpu, 2, DType> &bbox,
      const Tensor<cpu, 4, DType> &trans,
      const Tensor<cpu, 4, DType> &top_count,
      const bool no_trans,
      const nnvm::Tuple<float> spatial_scale,
      const int output_dim,
      const int group_size,
      const int pooled_size,
      const int part_size,
      const int sample_per_part,
      const float trans_std) {
      // NOT_IMPLEMENTED;
      return;
    }
  
    template<typename DType>
    inline void DeformablePSROIPoolv2BackwardAcc(const std::vector<Tensor<cpu, 4, DType>> &in_grads,
      const Tensor<cpu, 4, DType> &trans_grad,
      const Tensor<cpu, 4, DType> &out_grad,
      const std::vector<Tensor<cpu, 4, DType>> &datas,
      const Tensor<cpu, 2, DType> &bbox,
      const Tensor<cpu, 4, DType> &trans,
      const Tensor<cpu, 4, DType> &top_count,
      const bool no_trans,
      const nnvm::Tuple<float> spatial_scale,
      const int output_dim,
      const int group_size,
      const int pooled_size,
      const int part_size,
      const int sample_per_part,
      const float trans_std) {
      // NOT_IMPLEMENTED;
      return;
    }
  }  // namespace mshadow
  
  namespace mxnet {
  namespace op {
  
    template<>
    Operator *CreateOp<cpu>(DeformablePSROIPoolingv2Param param, int dtype) {
      Operator* op = nullptr;
      MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
        op = new DeformablePSROIPoolingv2Op<cpu, DType>(param);
      });
      return op;
    }
  
    Operator *DeformablePSROIPoolingv2Prop::CreateOperatorEx(
      Context ctx, std::vector<TShape> *in_shape,
      std::vector<int> *in_type) const {
      std::vector<TShape> out_shape, aux_shape;
      std::vector<int> out_type, aux_type;
      CHECK(InferType(in_type, &out_type, &aux_type));
      CHECK(InferShape(in_shape, &out_shape, &aux_shape));
      DO_BIND_DISPATCH(CreateOp, param_, in_type->at(0));
    }
  
    DMLC_REGISTER_PARAMETER(DeformablePSROIPoolingv2Param);
  
    MXNET_REGISTER_OP_PROPERTY(_contrib_DeformablePSROIPoolingv2, DeformablePSROIPoolingv2Prop)
      .describe("Performs deformable position-sensitive region-of-interest pooling on inputs.\n"
        "The DeformablePSROIPoolingv2 operation is described in https://arxiv.org/abs/1703.06211 ."
        "batch_size will change to the number of region bounding boxes after DeformablePSROIPoolingv2")
      .add_argument("data", "NDArray-or-Symbol[]", "Input data[], rois, trans to the pooling operator")
      .add_arguments(DeformablePSROIPoolingv2Param::__FIELDS__())
      .set_key_var_num_args("num_args");
  }  // namespace op
  }  // namespace mxnet
  