Skip to content

[Relay][Documentation] Behavior of relay.stack does not appear to match documentation #7129

@slyubomirsky

Description

@slyubomirsky

The documentation for tvm.relay.stack states that its input can be either a list of Relay expressions or a tuple. However, if you give a Relay expression with a tuple output as an input to tvm.relay.stack, this will result in a Python type error, as the function first tries to coerce the input into a Python list. The functionality should either be made to match the documentation or the documentation should be corrected to reflect the intended use.

Edit: Based on test_stack, it appears to work with tuple literals but not expressions that evaluate to tuples. I will create a specific test case to demonstrate this issue.

For example, the following will result in a Python type error:

    x = relay.Tuple([relay.const(np.random.rand(1, 1)), relay.const(np.random.rand(1, 1))])
    y = relay.Var('y')
    l = relay.Let(y, x, y)
    z = relay.stack(l, axis=1)

@hogepodge

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