This sounds very incellish. It’s not considered sexual harrasment to politely gauge interest and immediately back off when you see the signs they aren’t interested.
There's no meaningful difference here, particularly if you're a grad student. But I guess you'll now say that undergrads are allowed to ask somebody twice, but grad students must not ask more than once? Or maybe you'll just insult me and tell me to be miserable quietly like other people in this discussion already have.
There is a certain level of professional conduct that people expect in a professional setting that’s not there in school.
Also, I would be very wary of approaching someone at the gym who was working out. I use to teach at gyms part time when I was single. Women would have to really start the conversation with me before I would make any move.