From physics calculation, almost half motion energy is killed during 6% uphill e-bike riding at 15 mph. Although in theory, kinetic energy equaled to half mass and velocity squared, can be transferred to the equivalent potential energy (mass x gravitational acceleration x height), but energy consumption on flat road is some of kinetic energy only in ebike motion.
It depends on tire, mechanical loss, air resistance relating to moving velocity, riding manner.
On uphill path, a lot of kinetic energy will be converted to equivalent gravitational potential, and be wasted completely.
It is better to ride light-weight ebike while go uphill often for reducing battery output loading.