Yes you can. To do this, roast or bake large sweet potatoes in advance so they can cool before you use them.  Take off the skin, then with a potato masher, mash the whole sweet potatoes really well. Alternatively, pop the flesh of the cooked sweet potatoes into the bowl of a stand mixer and using the paddle attachment whip them until smooth. For the texture of sweet potato pie filling to be right, you want to get it really smooth.