Suppose I have a loss term as shown below:
G_sample = G(z)
D_fake = D(G_sample)

# Generator loss
G_loss = 0.5 * torch.mean((D_fake - 1)**2)

G_loss.backward()
G_solver.step()
reset_grad()

If I add any ordinary float variable to G_loss before .backward(),
for example,
G_loss = G_loss + avg_pixel_value
Does avg_pixel_value has any effect when doing back prop?
Or it is completely ignored?
Since avg_pixel_value itself cannot use .backward() api, I have a doubt of its effectiveness.
My question is can I add ordinary float terms to PyTorch Loss?
Many thanks.