<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def global_step(self) -> int: """ Evaluates the value of the global step variable if it is set, otherwise returns the current iteration number. """

        if self.session is None or self.global_step_tensor is None:
            return self.iteration_no + self.init_global_step
        else:
            return self.session.run(self.global_step_tensor)