I think it would be useful if you could provide a simple example where you’re struggling with set_data, as the question is quite abstract. In general, everything your model needs to get parameters to the right spot is data, so you need to either put it all into mutable data containers, or re-structure your data so you don’t need the indices.