Why robertashare.config.encoder.architectures is different from type(list(robertashare.children())[0])?

I am new to HF and I am I am still familiarising with classes config files etc
While playing with an EncoderDecoderModel I had this doubt:

robertashare = EncoderDecoderModel.from_encoder_decoder_pretrained(encoder_pretrained_model_name_or_path="roberta-base",
                                                                decoder_pretrained_model_name_or_path="roberta-base",
                                                                tie_encoder_decoder=True)

print(robertashare.config.encoder.architectures)
print(type(list(robertashare.children())[0]))

Here the first print logs “[‘RobertaForMaskedLM’]” and the second “<class ‘transformers.models.roberta.modeling_roberta.RobertaModel’>”
Why is it? I was expecting these two to match.
The same mismatch arises for the decoder:

print(robertashare.config.decoder.architectures)
print(type(list(robertashare.children())[1]))

The first print logs “[‘RobertaForMaskedLM’]” and the second class “<class ‘transformers.models.roberta.modeling_roberta.RobertaForCausalLM’>”

Anyone could clarify?
Thanks in advance :smiley: