Skip to contents

Torch-style 2D convolution in NCHW layout: x is [batch, in_channels, height, width], weight is [out_channels, in_channels / groups, kh, kw], output is [batch, out_channels, out_h, out_w]. Symmetric zero padding.

Usage

nv_conv2d(
  x,
  weight,
  stride = 1L,
  padding = 0L,
  dilation = 1L,
  groups = 1L,
  precision = "highest"
)

Arguments

x

(arrayish)
[N, C_in, H, W].

weight

(arrayish)
[C_out, C_in / groups, kH, kW].

stride

(integer())
Length 1 or 2.

padding

(integer())
Symmetric padding, length 1 or 2.

dilation

(integer())
Kernel dilation, length 1 or 2.

groups

(integer(1))
Grouped/depthwise convolution.

precision

(character(1))
"highest", "high" or "default".

Value

arrayish [N, C_out, out_H, out_W].