Do we say that a function $f$ is uniformly almost periodic in the aforementioned proof if $f$ is bounded (in the sense that $||f||_{L^\infty}\leq 1$) and that there exists a natural number $d>0$ such that $f\in UAP^d$?
Edit: the proof in question appears in Tao's paper "A quantitative ergodic theory proof of Szemerédi's theorem".