Add a layer of Gruyère cheese.
Arrange a layer of sweet potato slices at the bottom.
Butter a 9x13-inch baking dish.
Cover with foil and bake for 30 minutes.
In a small pot, heat cream and garlic just until it simmers.
Let it cool for 5 minutes before serving.
Pour the warm cream over the potatoes.
Preheat the oven to 400°F (204°C).
Remove foil and bake for another 15-20 minutes until potatoes are tender and cheese is golden brown.
Repeat the layers until all ingredients are used, ending with cheese.
Sprinkle with salt, pepper, and thyme.