Ibrahim Sufi
MModular
•Created by Ibrahim Sufi on 7/10/2024 in #questions
Create shorter name for sturct attribute without transfering ownership
I want to do something like this
where
transformer_weights
is simply an shorter name for mojo_model.transformer_weights but doesn't transfer ownership. However the code above throws the error field 'mojo_model.transformer_weights' destroyed out of the middle of a value, preventing the overall value from being destroyed
because the second line transfers ownership. Is there a way to do this in mojo?2 replies