drujensen
drujensen
MModular
Created by Martin Dudek on 6/7/2024 in #questions
Best way to make a struct of CollectionElements to conform to CollectionElement.
6 replies
MModular
Created by Martin Dudek on 6/7/2024 in #questions
Best way to make a struct of CollectionElements to conform to CollectionElement.
Does that mean copy the address instead of the value? If so, why not do this for all the fields? Is it something to do with primitive types?
6 replies
MModular
Created by Martin Dudek on 6/7/2024 in #questions
Best way to make a struct of CollectionElements to conform to CollectionElement.
sometimes I see in the moveinit a caret ^ symbol at the end of the assignment.
fn __moveinit__(inout self, owned other: Graph):
self.inputs = other.inputs^
self.params = other.params^
self.nodes = other.nodes^
self.outputs = other.outputs^
self.loss_out = other.loss_out
self.symbol_count = other.symbol_count
fn __moveinit__(inout self, owned other: Graph):
self.inputs = other.inputs^
self.params = other.params^
self.nodes = other.nodes^
self.outputs = other.outputs^
self.loss_out = other.loss_out
self.symbol_count = other.symbol_count
6 replies