@rsvarma
I am not very clear if I got your point. To avoid ambiguity (e.g. what input ? input of generator or discriminator) you may can use words exactly what I typed .
inputs
| mask
masked inputs
| generator (Electraformlm)
gen logits
| gumbel softmax
generated
| discriminator(electraformpretraining)
disc logits

But I will try to list something so that we can confirm whether our understanding are the same.

You by yourself initialize a model instance ElectraForMaskedLM as generator and a model instanceElectraForPreTraining as discriminator

The input of generator is masked_inputs that you mask from inputs.
The input of discriminator is generated that you feed generator and then sample from the output of generator

generated could only be different from inputs on masked positions

generated on some positions of masked positions could be also the same with the original inputs, it depends on how generator can correctly predict on that positions

Example:
inputs: “I am a super hero . You are too !”
masked_inputs: “I [MASK] a super hero. You [MASK] too !”
generated: “I is a super hero . You are too !”
is_replaced: “F T F F F F F F F F”