This workflow should work as shown in this dummy example:
# Setup
generator = nn.Conv2d(3, 3, 3, 1, 1)
dummy = nn.Conv2d(3, 3, 3, 1, 1)

data = torch.randn(1, 3, 24, 24)
target = torch.randn(1, 3, 24, 24)

# Freeze dummy model
for param in dummy.parameters():
    param.requires_grad_(False)

# Forward pass for data
out = generator(data)
out = dummy(out)

# Forward pass for target
target = dummy(target)

# Loss calculation
loss = ((out - target)**2).sqrt().mean()
loss.backward()

# Check gradients
print(generator.weight.grad)
print(dummy.weight.grad)

As you can see, generator will get valid gradients, while dummy won’t.
Could you post a code snippet to reproduce this issue, so that we could have a look?