()
| 380 | |
| 381 | |
| 382 | def test_relax_base_op(): |
| 383 | @R.function |
| 384 | def foo(x: R.Tensor((4, 4), "float32")): |
| 385 | alloc = R.builtin.alloc_tensor(R.shape([4, 4]), runtime_device_index=0, dtype="float32") |
| 386 | shape = R.shape_of(alloc) |
| 387 | return shape |
| 388 | |
| 389 | x = relax.Var("x", R.Tensor((4, 4), "float32")) |
| 390 | bb = relax.BlockBuilder() |
| 391 | with bb.function("foo", (x,)): |
| 392 | alloc = bb.emit(relax.op.builtin.alloc_tensor(relax.ShapeExpr((4, 4)), "float32", 0)) |
| 393 | shape = bb.emit(relax.op.shape_of(alloc)) |
| 394 | bb.emit_func_output(shape) |
| 395 | |
| 396 | _check(foo, bb.get()["foo"]) |
| 397 | |
| 398 | |
| 399 | def test_relax_shape_to_tensor(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…