What should a TA do if they cannot do all of the assigned homework for a class?
You should ask the professor to show you how to work the problem. It is also fine to ask the professor to confirm that all of your solutions are correct.
The professor is responsible for making sure the students' work is scored correctly, and since he wrote the questions, it is his responsibility to either provide you with the solutions or to check your solutions before you assign final grades.
Besides being responsible to the students in the course, the professor also has an obligation to support your development as a TA, which includes helping you work through any gaps or obstacles in your own learning.
Since you have already taken the initiative to work through the assignment on your own, the professor will likely be happy to help you, and you should not feel intimidated or embarrassed to ask.
You should ask the professor (I wouldn't necessarily wait for office hours: those are for the students, and working with a TA is a different matter), and don't be ashamed by the fact that you couldn't solve the problem. In fact, apart from a trivial mistake/misprint/missing condition in the problem statement, there is also a possibility that the professor missed something more conceptual, seriously underestimating the difficulty of the problem (e. g., thought of a solution that does not actually work in that particular case). I've been there in all roles: as a student and as a TA and as a professor :).
If, in fact, you regularly fail to solve problems that some students do solve, then its another issue; you should follow the lectures and read books etc. to be at least at the level of the best students.
Discussing with TAs is understood to be a part of the professor's workload when giving a course. See mister Feynman doing this: