JasonGross / guarantees-based-mechanistic-interpretability

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

set_params should not modify objects in place

JasonGross opened this issue · comments

I spent the past ~30 minutes confused about why my code was breaking, and it boiled down to "set_params mutates the object when I was expecting it not to". I think this is likely to bite us again in the future.

fixed (with test cases) -- the deep setattr is annotated with None type (to make it clear it mutates state), and set_params is non-mutating