Only 18% of computer science majors are women. Mike Appleton/General Motors GM wants more women to help build the cars of the future and it’s making big moves to ensure that it happens.

The automaker announced Wednesday that it is partnering with four new non-profits to create programs aimed at increasing the number of women and other minorities in STEM education.

GM’s CEO Mary Barra said that the partnerships will not only help diversify the workforce, but it will also help bring more coding talent to the automotive industry at a time when it desperately needs it.

"A car today has hundreds of million of miles of code. And we do see a [talent] shortage if we don’t address this," Barra said during a discussion with journalists on Tuesday in New York City.

A growing focus on connectivity, electrification, and autonomy has spurred GM to increasingly recruit more software engineers.

But while the boom for coding jobs is growing in the auto industry, the number of female candidates to fill these positions is not. This primarily stems from the fact that there simply aren't that many women getting computer science degrees.

In fact, only 18% of computer science majors are women, according to the latest statistics from the National Center for Education Statistics.

To help bridge this gap, GM announced it is partnering with Code.org, Black Girls Who Code, Institute of Play, and Digital Promise to implement programs to bring more women into STEM education. The automaker is giving each organization a grant of $200,000 to $250,000 to help them accomplish this.

"I think in five years, when you look at all of these initiatives, we are going to see tremendous progress," Barra said.

In January, the automaker also gave Girls Who Code, a non-profit organization that provides after-school programs to teach girls in 6 to 12th-grade computing skills, $250,000. The aim of the organization is to better equip girls with the computing skills they need so that they can pursue computer-science degrees once they get to college.

GM's focus on STEM education makes sense given the direction the auto industry is moving in.

The auto giant has been making big moves to push into emerging areas like autonomous vehicles, electric cars, and mobility services.

In 2016 alone, GM invested some $500 million in Lyft, purchased the self-driving startup Cruise Automation, and launched its all-electric Chevy Bolt.

Earlier this month, GM announced it had finished making 130 self-driving Chevy Bolts. The vehicles are being added to the company's fleet of 50 self-driving Bolts, bringing its testing fleet to 180 autonomous vehicles. GM has also more than tripled the Cruise Automation team since it purchased the company, Barra said. She said there were about 40 people when GM bought the startup, and now there are close to 200 employees at the company.

But it's not just the auto industry that is being disrupted. Barra said that just about every industry is being changed by technology in some way and that these investments in STEM education will help ensure that women have the opportunity to pursue their careers in whatever industry they choose.

"If you look at the world right now, there is not a single industry that technology isn’t impacting, disrupting, or transforming," Barra said. "And I think education is so foundational for our children today, to make sure they have the right education, to make sure they have the best care that they need for this future that is going to change at a very rapid pace."