// Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
#include <torch/script.h>
#include "nms_3d.h"
#include "ROIAlign_3d.h"
#include "overlap_3d.h"
#include "deformable_conv_3d.h"
#include "modulated_deformable_conv_3d.h"

using namespace at;

static auto registry =
    // torch::jit::RegisterOperators()
    torch::RegisterOperators()
    .op("nodulenet::nms_3d", &nms_3d)
    .op("nodulenet::overlap_3d", &overlap_3d)
    .op("nodulenet::roi_align_3d_forward(Tensor input, Tensor rois, float spatial_scale, int pooled_depth, int pooled_height, int pooled_width, int sampling_ratio) -> Tensor", &ROIAlign_3d_forward)
    .op("nodulenet::roi_align_3d_backward(Tensor grad, Tensor rois, float spatial_scale, int pooled_depth, int pooled_height, int pooled_width, int batch_size, int channels, int depth, int height, int width, int sampling_ratio) -> Tensor", &ROIAlign_3d_backward)
    .op("nodulenet::deform_conv3d_forward", &deform_conv3d_forward)
    .op("nodulenet::deform_conv3d_backward", &deform_conv3d_backward)
    .op("nodulenet::modulated_deform_conv3d_forward", &modulated_deform_conv3d_forward)
    .op("nodulenet::modulated_deform_conv3d_backward", &modulated_deform_conv3d_backward);
// (Tensor input, Tensor weight, Tensor bias, Tensor offset, Tensor output, int kernel_h, int kernel_w, int kernel_l,int stride_h, int stride_w, int stride_l, int pad_h, int pad_w, int pad_l,int dilation_h, int dilation_w, int dilation_l,int group, int deformable_group, int in_step, bool with_bias)
// (Tensor input, Tensor weight, Tensor bias, Tensor offset,Tensor grad_input, Tensor grad_weight, Tensor grad_bias,Tensor grad_offset, Tensor grad_output,int kernel_h, int kernel_w, int kernel_l,int stride_h, int stride_w, int stride_l,int pad_h, int pad_w, int pad_l,int dilation_h, int dilation_w, int dilation_l,int group, int deformable_group, int in_step, bool with_bias)