Stat upgrades on non maxed troops

Anyone knows what happens with the stats on units after you upgrade that particular unit?

For example I am upgrading the speed of my ogre which is not the max level ogre.

Will this speed upgrade be set to the new ogre level as well, after I get it from the dungeon?