MCPcopy Create free account
hub / github.com/apache/tvm / test_conv2d

Function test_conv2d

tests/python/nightly/test_nnapi/test_ops.py:291–321  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

289
290
291def test_conv2d():
292 remote_obj, tracker = remote()
293
294 def create_model() -> tvm.IRModule:
295 @tvm.script.ir_module
296 class Module:
297 @R.function
298 def main(
299 i0: R.Tensor((1, 3, 224, 224), "float32"),
300 i1: R.Tensor((64, 3, 3, 3), "float32"),
301 i2: R.Tensor((1, 64, 1, 1), "float32"),
302 ):
303 with R.dataflow():
304 t0 = R.nn.conv2d(i0, i1, strides=(1, 1), padding=(1, 1))
305 t0 = R.add(i2, t0)
306 R.output(t0)
307 return t0
308
309 return Module
310
311 mod = create_model()
312 verify(
313 remote_obj,
314 tracker,
315 mod,
316 inputs=[
317 np.random.random(size=(1, 3, 224, 224)).astype("float32"),
318 np.random.random(size=(64, 3, 3, 3)).astype("float32"),
319 np.random.random(size=(1, 64, 1, 1)).astype("float32"),
320 ],
321 )
322
323
324def test_max_pool2d():

Callers

nothing calls this directly

Calls 4

remoteFunction · 0.90
create_modelFunction · 0.70
verifyFunction · 0.70
astypeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…