Really the last indendation bug fix.
authorjoel-shor <joelshor@google.com>
Tue, 20 Mar 2018 22:04:13 +0000 (00:04 +0200)
committerjoel-shor <joelshor@google.com>
Tue, 20 Mar 2018 22:04:13 +0000 (00:04 +0200)
tensorflow/contrib/data/python/kernel_tests/resample_test.py
tensorflow/contrib/data/python/ops/resampling.py

index 0e3131b..38efcd3 100644 (file)
@@ -103,7 +103,8 @@ class ResampleTest(test.TestCase):
 
     classes, _ = zip(*returned)
     bincount = np.bincount(
-      np.array(classes), minlength=num_classes).astype(np.float32) / len(classes)
+        np.array(classes),
+        minlength=num_classes).astype(np.float32) / len(classes)
 
     self.assertAllClose(target_dist, bincount, atol=1e-2)
 
index e440d4a..0e127f7 100644 (file)
@@ -104,10 +104,10 @@ def rejection_resample(class_func, target_dist, initial_dist=None, seed=None):
     def _gather_and_copy(class_val, acceptance_prob, data):
       return (class_val, array_ops.gather(acceptance_prob, class_val), data)
     current_probabilities_and_class_and_data_ds = dataset_ops.Dataset.zip(
-      (class_values_ds, acceptance_dist_ds, dataset)).map(_gather_and_copy)
+          (class_values_ds, acceptance_dist_ds, dataset)).map(_gather_and_copy)
     filtered_ds = (
-      current_probabilities_and_class_and_data_ds
-        .filter(lambda _1, p, _2: random_ops.random_uniform([], seed=seed) < p))
+          current_probabilities_and_class_and_data_ds
+              .filter(lambda _1, p, _2: random_ops.random_uniform([], seed=seed) < p))
     return filtered_ds.map(lambda class_value, _, data: (class_value, data))
 
   return _apply_fn