The magnetic moments of non-uniformly magnetized grains