Preheat the oven to 350°F (175°C). Grease a loaf pan.
In a large mixing bowl, combine the mashed sweet potatoes, granulated sugar, brown sugar, and vegetable oil.
Add the eggs and vanilla extract to the mixture, whisking until well combined.
In a separate bowl, whisk together the flour, baking powder, baking soda, cinnamon, and salt.
Gradually add the dry ingredients to the wet mixture, stirring until just combined.
Fold in the chopped nuts, if using, and pour the batter into the prepared loaf pan.
Bake for 60-70 minutes, or until a toothpick inserted comes out clean.
Allow to cool in the pan for 10 minutes before transferring to a wire rack.