Fix up remaining lint and format in TensorFlow Privacy.

PiperOrigin-RevId: 424948247
This commit is contained in:
Michael Reneer 2022-01-28 13:43:44 -08:00 committed by A. Unique TensorFlower
parent dd31737cb7
commit 25571aaf87

View file

@ -272,8 +272,9 @@ class BoltOnModel(Model): # pylint: disable=abstract-method
num_samples = sum(class_counts)
weighted_counts = tf.dtypes.cast(
tf.math.multiply(num_classes, class_counts), self._dtype)
class_weights = tf.Variable(num_samples, dtype=self._dtype) / \
tf.Variable(weighted_counts, dtype=self._dtype)
class_weights = (
tf.Variable(num_samples, dtype=self._dtype) /
tf.Variable(weighted_counts, dtype=self._dtype))
else:
class_weights = _ops.convert_to_tensor_v2(class_weights)
if len(class_weights.shape) != 1: