Skip to content

Module that is flexible in which submodule is used #1026

Answered by avital
ingmarschuster asked this question in Q&A
Discussion options

You must be logged in to vote

I think that after 9bf7161 was committed, you should be able to simply pass an unbound module instance from the top-level without wrapping in a lambda. Could you give it a shot?

e.g. model = AverageSimilarity(LaplaceSimilarity(3.))

(On another note, there's no need to define empty setup methods)

(Oh, and your LaplaceSimilarity class doesn't really need to be a module as it doesn't hold variables. You could simply make it a vanilla Python dataclass)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@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