Skip to content

Parameters not available as instance properties after setup() #1013

Discussion options

You must be logged in to vote

Self-answering: I forgot to use apply rather than calling the method directly. Calling it directly meant the parameters where not set. corrected function:

def test():
    mf = MultipleForw()
    X = np.arange(5)
    par = mf.init(rand.PRNGKey(0), X)
    print(mf.apply(par, X))
    print(mf.apply(par, X, method = mf.call2))

The self.s2 version works as expected and is equivalent to the self.s1 version.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@avital
Comment options

@ingmarschuster
Comment options

Answer selected by ingmarschuster
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants