October 9, 2020 | 4:20am

No matter how bad Gleyber Torres may have looked at times this season, Aaron Boone remained confident in the young shortstop.

And even as the regular season neared an end and Torres continued to be unproductive with just one hit in his final 14 at-bats, Boone remained certain Torres would right himself during the playoffs.

It seems Boone was right.

Torres has been one of the Yankees’ best hitters this October and provided perhaps their biggest hit of the playoffs with his monstrous two-run homer off Ryan Yarbrough in the bottom of the sixth inning of their 5-2 win Thursday over Tampa Bay in Game 4 of the ALDS at Petco Park in San Diego to force Game 5.

“I never feel pressure,’’ Torres said. “I like to play with 40,000 people in the stands and it’s loud.”

Gleyber Torres
Gleyber TorresAP

That will have to wait, but Torres wasn’t bothered by the lack of a crowd.

The shortstop walked in the Yankees’ two-run second, but he made his real impact with the Yankees holding onto a one-run lead in the sixth, seemingly unable their bullpen any cushion.

After Torres fouled a ball off his calf in his previous at-bat, leaving him hobbled, he stayed in the game and came up again in the sixth, looking for the same pitch — a cutter.

When he got it, Torres turned on it and the only question was whether it would stay fair.

“It was just a matter of time,’’ Luke Voit said. “I knew Gleyber was gonna do something big.”

After Voit sent a ball to the track in center to start the bottom of the sixth, Brett Gardner singled to bring up Torres, who turned on the pitch and blasted a towering shot for the fifth postseason homer of his career.

Then Torres added a single in the eighth, stole a base and scored on Kyle Higashioka’s single. He’s reached base in 16 of 27 plate appearances in six games this postseason. He’s also reached base in 18 of his 20 playoff games.