17 #include "caffe2/operators/deform_conv_op.h" 18 #include "caffe2/operators/conv_pool_op_base.h" 19 #include "caffe2/operators/deform_conv_op_impl.h" 23 OPERATOR_SCHEMA(DeformConv)

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

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

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

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

62 "The 1D bias blob that is added through the convolution; " 67 "Output data blob that contains the result of the " 68 "convolution. The output dimensions are functions of the kernel size, " 69 "stride size, and pad lengths." Copyright (c) 2016-present, Facebook, Inc.