()
| 135 | |
| 136 | |
| 137 | def test_tensorrt_conv1d(): |
| 138 | # Regression test: explicit-batch (batch > 1) 1D convolution. The pre-TRT10 converter assumed an |
| 139 | # implicit batch dimension and dropped the spatial dimension under explicit batch. |
| 140 | @tvm.script.ir_module |
| 141 | class Conv1d: |
| 142 | @R.function |
| 143 | def main(data: R.Tensor((2, 8, 16), "float32"), weight: R.Tensor((4, 8, 3), "float32")): |
| 144 | with R.dataflow(): |
| 145 | out = relax.op.nn.conv1d(data, weight, padding=1) |
| 146 | R.output(out) |
| 147 | return out |
| 148 | |
| 149 | data = np.random.randn(2, 8, 16).astype("float32") |
| 150 | weight = np.random.randn(4, 8, 3).astype("float32") |
| 151 | patterns = [("tensorrt.nn.conv1d", is_op("relax.nn.conv1d")(wildcard(), wildcard()))] |
| 152 | _offload_and_compare(Conv1d, {"weight": weight}, patterns, data) |
| 153 | |
| 154 | |
| 155 | def test_tensorrt_max_pool2d(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…