operator:
name: DepthwiseConv2D
category: Contraction
difficulty: L3
formula: y[n,c,h,w] = bias[c] + sum_{kh,kw} x[n,c,h*s_h+kh*d_h-p_h,w*s_w+kw*d_w-p_w] * weight[c,kh,kw]
description: 二维深度卷积运算(每输入通道独立卷积,groups = C,无跨通道求和)
shape_support: 'x: [N, C, H, W], weight: [C, K_h, K_w], bias: [C]; 约束 groups == C'
attrs:
- name: kernelSize
type: ListInt
description: 卷积核大小
required: true
- name: stride
type: ListInt
description: 步长
required: true
- name: padding
type: ListInt
description: 填充
required: true
- name: dilation
type: ListInt
description: 膨胀率
required: true
- name: groups
type: Int
description: 分组数;depthwise 要求 groups == C(输入通道数)
required: true
inputs:
- name: x
description: 输入特征图
dtype:
- float16
- float32
- bfloat16
- name: weight
description: 卷积核
dtype:
- float16
- float32
- bfloat16
- name: bias
description: 偏置
dtype:
- float16
- float32
- bfloat16
outputs:
- name: y
description: 输出特征图
dtype:
- float16
- float32
- bfloat16
schema: depthwise_conv_2d(Tensor x, Tensor weight, Tensor bias, int[] kernelSize,
int[] stride, int[] padding, int[] dilation, int groups) -> Tensor y