Skip to content

[QST] [CuTeDSL] Branching: ValueError: unable to convert ... in type <class 'list'> to Numeric #2531

@HanGuo97

Description

@HanGuo97

What is your question?

Hi, I'm running into the following case, in which reassigning a list in a runtime branching (and only runtime branching) doesn't work.

import cutlass
import cutlass.cute as cute


@cute.jit
def f0():
    xs = [0, 1, 2]
    xs = [2, 3, 4]
    print(xs)


@cute.jit
def f1():
    xs = [0, 1, 2]
    if cutlass.const_expr(xs[0] == 0):
        xs = [2, 3, 4]
    print(xs)


@cute.jit
def f2():
    xs = [0, 1, 2]
    if xs[0] == 0:
        xs = [2, 3, 4]
    print(xs)

f0()
f1()
f2()  # --> ValueError

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions