()
| 228 | |
| 229 | |
| 230 | def test_tensorrt_conv2d_transpose(): |
| 231 | # Default IOHW kernel layout ([in, out, h, w]); output channels are weight_shape[1]. |
| 232 | @tvm.script.ir_module |
| 233 | class ConvTranspose: |
| 234 | @R.function |
| 235 | def main( |
| 236 | data: R.Tensor((2, 8, 16, 16), "float32"), weight: R.Tensor((8, 4, 3, 3), "float32") |
| 237 | ): |
| 238 | with R.dataflow(): |
| 239 | out = relax.op.nn.conv2d_transpose(data, weight, padding=1) |
| 240 | R.output(out) |
| 241 | return out |
| 242 | |
| 243 | data = np.random.randn(2, 8, 16, 16).astype("float32") |
| 244 | weight = np.random.randn(8, 4, 3, 3).astype("float32") |
| 245 | patterns = [ |
| 246 | ("tensorrt.nn.conv2d_transpose", is_op("relax.nn.conv2d_transpose")(wildcard(), wildcard())) |
| 247 | ] |
| 248 | _offload_and_compare(ConvTranspose, {"weight": weight}, patterns, data) |
| 249 | |
| 250 | |
| 251 | def test_tensorrt_conv3d_transpose(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…