Based on your description it seems you don’t want to train modelA as @shartzog suggested.
In that case, you could either wrap the forward pass of modelA in a with torch.no_grad() block or set the .requires_grad attribute of all parameters or modelA to False.