Skip to content

[BUG] Parser error with nn.dense #6470

@gussmith23

Description

@gussmith23

Parsing a Relay program which uses nn.dense seems to be finicky! I might be doing something wrong here, let me know!

A minimum working example:

import tvm
from tvm import relay
from tvm.relay.testing.mobilenet import get_workload

x = relay.var('x', shape = (3,))
y = relay.var('y', shape = (3,3))
prog = relay.nn.dense(x, y)
function = relay.Function([x, y], prog)
module = tvm.IRModule.from_expr(function)

print(module.astext())

tvm.parser.fromtext(module.astext())

# if we remove the "None" that is causing the error, we get a different error:
tvm.parser.fromtext(
'''
#[version = "0.0.5"]
def @main(%x: Tensor[(3), float32], %y: Tensor[(3, 3), float32]) -> Tensor[(3), float32] {
  nn.dense(%x, %y) /* ty=Tensor[(3), float32] */
}
'''
    )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions