Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
real_inputs,
device,
labels,
)
else:
if isinstance(discriminator, AutoEncodingDiscriminator):
setattr(discriminator, "embeddings", False)
loss = super(EnergyBasedDiscriminatorLoss, self).train_ops(
generator,
discriminator,
optimizer_discriminator,
real_inputs,
device,
labels,
)
if isinstance(discriminator, AutoEncodingDiscriminator):
setattr(discriminator, "embeddings", True)
return loss
device,
batch_size,
labels,
)
else:
if isinstance(discriminator, AutoEncodingDiscriminator):
setattr(discriminator, "embeddings", False)
loss = super(EnergyBasedGeneratorLoss, self).train_ops(
generator,
discriminator,
optimizer_generator,
device,
batch_size,
labels,
)
if isinstance(discriminator, AutoEncodingDiscriminator):
setattr(discriminator, "embeddings", True)
return loss