def __eq__(self, other):
    """Equality comparison based on encoded data."""
    if isinstance(other, Observation):
      return self.data == other.data
    else:
      return False
Equality comparison based on encoded data.
tensor2tensor/data_generators/gym_env.py