Skip to content

Stage "handles" missing in HCL models created via classes. #417

Answered by pasqoc
jcasas00 asked this question in Q&A
Discussion options

You must be logged in to vote

The following seems to work (note the wrapper for the member function version):

A = hcl.placeholder((10,10), "A")


def two_stage(A):
    B = hcl.compute(A.shape, lambda x, y: A[x, y] + 1, "B")
    C = hcl.compute(A.shape, lambda x, y: B[x, y] + 1, "C")
    return C

class testme:
    def __init__(self):
        pass

    def two_stage(self, A):
        B = hcl.compute(A.shape, lambda x, y: A[x, y] + 1, "B")
        C = hcl.compute(A.shape, lambda x, y: B[x, y] + 1, "C")
        return C

    @staticmethod
    def two_stage_static(A):
        B = hcl.compute(A.shape, lambda x, y: A[x, y] + 1, "B")
        C = hcl.compute(A.shape, lambda x, y: B[x, y] + 1, "C")
        return C


t = testme(…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by jcasas00
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants