(inp, w, b)
| 832 | return var |
| 833 | |
| 834 | def run_conv2d(inp, w, b): |
| 835 | O = F.conv2d( |
| 836 | inp, w, b if has_bias else None, stride=(SH, SW), padding=(PH, PW), |
| 837 | ) |
| 838 | if nonlinear_mode == "relu": |
| 839 | return F.relu(O) |
| 840 | else: |
| 841 | return O |
| 842 | |
| 843 | def run_conv_bias(inp, w, b, format="NCHW"): |
| 844 | b = b if has_bias else Parameter(np.zeros_like(b.numpy())) |