def _test_compute_quantiles_single_batch_helper(self, nptype):
     batch_1 = [np.linspace(1, 100, 100, nptype)]
     analyzer = impl._ComputeQuantiles(num_quantiles=3, epsilon=0.00001)
     out = np.array([[1, 35, 68, 100]], dtype=np.float32)
     self.assertCombine(analyzer,
                        np.array([batch_1]),
                        out,
                        check_np_type=True)
Esempio n. 2
0
 def _test_compute_quantiles_multipe_batch_helper(self, nptype):
   lst_1 = np.linspace(1, 100, 100, dtype=nptype).tolist()
   lst_2 = np.linspace(101, 200, 100, dtype=nptype).tolist()
   lst_3 = np.linspace(201, 300, 100, dtype=nptype).tolist()
   analyzer = impl._ComputeQuantiles(num_quantiles=5, epsilon=0.00001)
   out = [np.array([1, 61, 121, 181, 241, 300], dtype=np.float32)]
   self.assertCombine(
       analyzer, np.array([lst_1, lst_2, lst_3]), out, check_np_type=True)
Esempio n. 3
0
 def _test_compute_quantiles_multipe_batch_helper(self, nptype):
   batch_1 = [np.linspace(1, 100, 100, dtype=nptype)]
   batch_2 = [np.linspace(101, 200, 100, dtype=nptype)]
   batch_3 = [np.linspace(201, 300, 100, dtype=nptype)]
   analyzer = impl._ComputeQuantiles(num_quantiles=5, epsilon=0.00001)
   out = np.array([[61, 121, 181, 241]], dtype=np.float32)
   self.assertCombine(
       analyzer, np.array([batch_1, batch_2, batch_3]), out,
       check_np_type=True)