seb
seb
MModular
Created by seb on 10/22/2023 in #questions
List of memory-only structs
@Stijn I ended up abandoning a struct-based approach to neural nets; couldnt figure out any other workarounds without using register_passable("trivial"). However, if that class were only to contain things like pointers, numbers, and dynamic vectors, its size might not be so large as to make full copying prohibitive. One thing: If your register_passable("trivial") struct does contain pointers, you might want to implement a manual delete() method of some sort on the class which frees the pointer, and call that method in the __del__() method of whatever class owns the passable class, so that you don't end up with memory leaks
8 replies