2 tbsp. chopped fresh rosemary
1 cup shredded Gruyere cheese, divided
2½ cups low-fat milk
¼ tsp. white or black pepper
½ tsp. salt
3 tbsp. all-purpose flour
1 small onion, finely chopped (about 1 cup)
3 tbsp. extra-virgin olive oil, divided
2½ pounds sweet potatoes, peeled and cut into ¼-inch slices (about 8 cups)