1 #include "caffe2/operators/deform_conv_op.h" 2 #include "caffe2/operators/conv_pool_op_base.h" 3 #include "caffe2/operators/deform_conv_op_impl.h" 7 OPERATOR_SCHEMA(DeformConv)

10 .TensorInferenceFunction(ConvPoolOpBase<CPUContext>::TensorInferenceForConv)

12 Deformable convolution operator consumes an input vector, the kernel offsets 13 blob, the filter blob and the bias blob and computes the output. Other 14 parameters, such as the stride and kernel size, or the pads' sizes in each 15 direction are not necessary for input because they are provided by the 16 ConvPoolOpBase operator. Various dimension checks are done implicitly, and the 17 sizes are specified in the Input docs for this operator. As is expected, the 18 filter is convolved with a subset of the image using the deformed kernel as 19 specified by offsets blob and the bias is added; this is done throughout the 20 image data and the output is computed. 25 "Input data blob from previous layer; has size " 26 "(N x C x H x W), where N is the batch size, C is the number of channels, and" 27 " H and W are the height and width. Note that this is for the NCHW usage. On " 28 "the other hand, the NHWC Op has a different set of dimension constraints.")

32 "Offsets blob that specifies the deformed shape of the " 33 "kernel; consists of 2d offsets for each kernel element, one full set per " 34 "each output element; therefore has size (N x 2*kH*kW x H' x W') where N is " 35 "the batch size, kH and kW are the height and width of the kernel, H' and W' " 36 "are the output blob dimensions.")

40 "The filter blob that will be used in the convolutions; " 41 "has size (M x C x kH x kW), where C is the number of channels, and kH and " 42 "kW are the height and width of the kernel.")

46 "The 1D bias blob that is added through the convolution; " 51 "Output data blob that contains the result of the " 52 "convolution. The output dimensions are functions of the kernel size, " 53 "stride size, and pad lengths." A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...