I am confused here - set_array should not copy anything but take the stuff as is. But it not longer does this. So please don't free dic /dic_weights here and use the other set_array function that frees and doesn't copy