MCPcopy Index your code
hub / github.com/apache/tvm / test_tensorrt_conv1d

Function test_tensorrt_conv1d

tests/python/relax/test_codegen_tensorrt.py:137–152  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

135
136
137def 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
155def test_tensorrt_max_pool2d():

Callers

nothing calls this directly

Calls 4

is_opFunction · 0.90
wildcardFunction · 0.90
_offload_and_compareFunction · 0.85
astypeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…