ModularM
Modular14mo ago
4 replies
Gennadiy

Mojo equivalent of Python class parameters

In Python, you can create a class, say "model" and ask for its parameters using model.parameters.

Is there an equivalent for a struct in Mojo?

I would like to pass it to something like: torch.optim.Adam(model.parameters(), ...) .
Was this page helpful?