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

Function test_op_attrs

tests/python/relax/test_ast_printer.py:419–434  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

417
418
419def test_op_attrs():
420 x = rx.Var("x", R.Tensor((10,), "float32"))
421 # Manually create a Call with attributes to test printer support for Op attributes
422 op = tvm.ir.Op.get("relax.add")
423 attrs = tvm.ir.make_node("ir.DictAttrs", my_attr="my_value")
424 call_node = rx.Call(op, [x, x], attrs=attrs)
425
426 call_str = dump_ast(call_node, include_call_attrs=True)
427 assert_fields(
428 "Call",
429 {
430 "op": 'Op(name="relax.add")',
431 "attrs": '{"my_attr": "my_value"}',
432 },
433 call_str,
434 )
435
436
437def test_call_tir():

Callers

nothing calls this directly

Calls 4

dump_astFunction · 0.90
assert_fieldsFunction · 0.85
TensorMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…