Conv

Description

Performs a convolution operation using an input tensor and a filter to generate the output tensor.

Input

  • X: 4D or 5D tensor from the upper layer. When the input is 4D, the data type can be float16 or float. When the input is 5D, the data type can be float16.
  • W: weight tensor. For 2D convolution, the shape is [M, C/group, kH, kW], where C is the number of channels, kH and kW are the height and width of the kernel, and M is the number of feature maps. For more than two dimensions, the weight shape is [M, C/group, kD, kH, kW]. The number of channels in the output must be equal to W.shape[0] (assuming that the index of the shape array starts from 0). The data type can be float16.
  • B (optional): 1D tensor of type float16, with shape [M].

Attribute

  • auto_pad (optional): When X is NCHW, NOTSET, SAME_UPPER, SAME_LOWER, and VALID are supported. When X is NCDHW, only NOTSET and VALID are supported. The default value is NOTSET, indicating that explicit padding is used. SAME_UPPER or SAME_LOWER indicates that the input is padded for each axis. The padding is equally or almost equally distributed between the two sides (depending on whether it is even or odd). If the padding is an odd number, extra padding is added at the end of SAME_UPPER and at the beginning of SAME_LOWER.
  • dilations: a list of two integers for a 4D tensor or a list of five integers for a 5D tensor. This attribute specifies the dilation rate. The value range for the H and W dimensions is [1, 255]. If the attribute does not exist, the dilation along each spatial axis is 1 by default.
  • group: int32. This parameter must be set to 1. It indicates the number of blocked connections from the input channel to the output channel. Both the input and output channels must be exactly divided by group.
  • pads: a list of four integers for a 4D tensor or a list of six integers for a 5D tensor. This attribute specifies the top, bottom, left, and right padding. The value range is [0, 255].
  • strides: a list of four integers for a 4D tensor or a list of five integers for a 5D tensor. This attribute specifies the strides of the convolution along the height and width. The value range for the H and W dimensions is [1, 63]. By default, the N and C dimensions are set to 1.

Output

Y: output tensor of the convolution result. The output dimension is a function of the kernel size, stride size, and pad length.

Constraints

  • The value range for the W dimension of the input tensor X is [1, 4096].
  • The value range for the H and W dimensions of the input tensor W is [1, 255].
  • The operator does not support inputs of type float and float64 when the atc command-line option --precision_mode is set to must_keep_origin_dtype.

ONNX Opset Support

Opset v9/v10/v11/v12/v13/v14/v15/v16/v17/v18