Tory Lanez is not going down without a fight ... he has just asked a judge to throw out his conviction for shooting Megan Thee Stallion, claiming, among other things, prosecutors tried to dirty him up with irrelevant evidence.
Tory's lawyer, famed criminal defense attorney Jose Baez, claims in legal docs obtained by TMZ, prosecutors submitted a shirtless photo of Tory with a firearm tattoo on his chest. During trial, prosecutors said it was merely for identification purposes, but Baez is calling BS, saying prosecutors used the photo to underscore to the jury his client had a fondness for weapons.
There are numerous other grounds ... notably Baez says it was a reversible error for prosecutors to threaten to present Tory's rap lyrics to the jury.
And there's this ... Baez says the jury heard an 80-minute interview prosecutors had with Kelsey Harris -- Megan's friend who was in the car the night of the shooting. The audio was devastating to Tory's case, but Kelsey later recanted a lot of what she said in that interview.
Baez also says it was wrong to admit an Instagram post that included a comment from one of Megan's producers, claiming cops had matched bullets from Tory's gun to the fragments in Megan's foot.
Another claim ... it was wrong to allow statements Megan made to cops that Tory said to her immediately after the shooting, "Please don't say anything because I'm on probation."
Tory is facing 22 years in prison for three felony firearms violations. He's scheduled to be sentenced next month.
We covered all the latest developments in the latest episode of The TMZ Podcast.