(residual_batch)
| 1048 | dtype = "float16" |
| 1049 | |
| 1050 | def get_mod(residual_batch): |
| 1051 | with IRBuilder() as builder: |
| 1052 | with relax_builder.function(): |
| 1053 | R.func_name("main") |
| 1054 | data = R.arg("data", R.Tensor(data_shape, dtype)) |
| 1055 | weight = R.arg("weight", R.Tensor(weight_shape, dtype)) |
| 1056 | bias = R.arg("bias", R.Tensor((1, 1, weight_shape[0]), dtype)) |
| 1057 | residual = R.arg( |
| 1058 | "residual", R.Tensor((residual_batch, 1, 1, weight_shape[0]), dtype) |
| 1059 | ) |
| 1060 | |
| 1061 | with R.dataflow() as frame: |
| 1062 | output = R.emit( |
| 1063 | R.nn.conv2d( |
| 1064 | data, |
| 1065 | weight, |
| 1066 | out_dtype=dtype, |
| 1067 | padding=(1, 1), |
| 1068 | data_layout="NHWC", |
| 1069 | kernel_layout="OHWI", |
| 1070 | ) |
| 1071 | ) |
| 1072 | output = R.emit(output + bias) |
| 1073 | output = R.emit(R.nn.relu(output)) |
| 1074 | output = R.emit(R.add(output, residual)) |
| 1075 | R.output(output) |
| 1076 | |
| 1077 | R.func_ret_value(frame.output_vars[0]) |
| 1078 | |
| 1079 | func = builder.get() |
| 1080 | return tvm.IRModule({"main": func}) |
| 1081 | |
| 1082 | low = -1 |
| 1083 | high = 1 |
no test coverage detected
searching dependent graphs…