Unable to parse `broadcast_to`

When I tried to call tvm.parse.parse_expr, broadcast_to seems to be buggy and cannot be parsed in recent TVM.

import tvm
from tvm import relay, auto_scheduler
from tvm.relay import data_dep_optimization as ddo
import tvm.relay.testing
from tvm.contrib import graph_executor
from tvm.contrib.utils import tempdir

a = relay.var("a", shape=[1, 10])
out = relay.broadcast_to(a, shape=[1,10])
func = relay.Function([a], out)

SEMVER = '#[version = "0.0.5"]\n'
code = str(func)
expr = tvm.parser.parse_expr(SEMVER + code)
print(expr)

'''
error: unable to determine the 'attrs_type_key' with which to represent the call attributes for this operator
 --> string:3:3
   |  
 3 |    broadcast_to(%a, shape=[1, 10])
   |    ^^^^^^^^^^^^                   
'''

Is there any workaround through for this issue?

1 Like