They are equivalent graphs.
However, in PyTorch, if you use torch.nn layers, they only know how to do batch processing.
So, your for loop over batch size is redundant, and infact incorrect, because model_A probably doesn’t know how to handle INa_i to give outa_i, but directly does: outa = model_A(ina).
You can fake batch processing by making Ina_i have a batch dimension of size 1.