Neither of those 2 cases was because the deceased was black. Both cases were cases of self-defense. Police are trained to shoot in self-defense, as soon as it is plausible that they themselves might be shot.
This can be any time a suspect (including children) is carrying a gun or any device which appears to be a real gun (Tamir Rice), or in instances when a suspect's hand disappears from the cop's view. Once the hand disappears, police academy rule is shoot and ask questions later, or else you (the cop) may be dead seconds later.
This should be taught in every elementary school in America.
As far as I know it is not taught anywhere in any school in America- perhaps the #1 deficiency of our education system. If this were taught in schools as it should be, dozens of people shot by police would not have been, and many riots would not have occured.