@classmethod
    def get_target_space_wrapper(cls, name, get_target_space):
        @functools.wraps(get_target_space)
        def outer(self):
            if (not self.rnn_friendly and self._requires_reshape and
                    (not isinstance(get_target_space(self), SequenceSpace) and
                        not isinstance(get_target_space(self),
                                       SequenceDataSpace))):
                if isinstance(self.mlp.input_space, SequenceSpace):
                    return SequenceSpace(get_target_space(self))
                elif isinstance(self.mlp.input_space, SequenceDataSpace):
                    return SequenceDataSpace(get_target_space(self))
            else:
                return get_target_space(self)
        return outer
Same thing as set_input_space_wrapper.
dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/sandbox/rnn/models/mlp_hook.py/RNNWrapper.get_target_space_wrapper