conv2d_backprop_filter
Description
Computes 2D deconvolution of the float32 type with the given 5HD data and 5HD out_backprop.
The shape of the data tensor is 5HD, that is, (N, C1, H, W, C0). The shape of the out_backprop tensor is 5HD, that is, (N, C1, H, W, C0).
Prototype
conv2d_backprop_filter(input_x, out_backprop, filter_sizes, para_dict)
Parameters
- input_x: a 5HD tensor of type float16, for the feature map.
- out_backprop: backprop of the 2D convolution. Currently, the float16 type is supported.
- filter_size: weight matrix size.
- para_dict: a dictionary for the key-value pairs, including the following keys:
- strides: a list of the strides along the H and W directions of the feature map.
- padding: a list for the padding lines along the H and W directions of the feature map.
- dilations: a list of the dilations along the H and W directions of the filter.
- groups: group for 2D convolution filter. Defaults to 1.
- res_dtype: output data type.
- kernel_name: operator name.
Returns
res_tensor: result tensor.
Restrictions
This API cannot be used in conjunction with other TBE DSL APIs.
Applicability
Example
from tbe import tvm
from tbe import dsl
out_backprop_shape = (1, 1, 7, 7, 16)
out_backprop_dtype = "float16"
fmap_shape = (1, 1, 7, 7, 16)
fmap_dtype = "float16"
filter_sizes = (16, 16, 1, 1)
out_backprop = tvm.placeholder(out_backprop_shape, name="out_backprop", dtype=out_backprop_dtype)
fmap = tvm.placeholder(fmap_shape, name="fmap", dtype=fmap_dtype)
strides = [1, 1]
padding = [0, 0, 0, 0]
dilations = [1, 1, 1, 1]
groups = 1
res_dtype = "float32"
kernel_name = "conv2d_backprop_filter_dx_1_1_7_7_16_dy_1_1_7_7_16_dw_16_16_1_1_s_1_1_p_SAME"
para_dict = {
"strides": strides,
"padding": padding,
"dilations": dilations,
"groups": groups,
"res_dtype": res_dtype,
"kernel_name": kernel_name
}
filter_backprop = dsl.conv2d_backprop_filter(
input_x=fmap,
out_backprop=out_backprop,
filter_sizes=filter_sizes,
para_dict=para_dict
)
Parent topic: NN Compute APIs