def test_nested_gaussian_average_with_clip_no_noise(self):
        with self.cached_session() as sess:
            query1 = gaussian_query.GaussianAverageQuery(l2_norm_clip=4.0,
                                                         sum_stddev=0.0,
                                                         denominator=5.0)
            query2 = gaussian_query.GaussianAverageQuery(l2_norm_clip=5.0,
                                                         sum_stddev=0.0,
                                                         denominator=5.0)

            query = nested_query.NestedQuery([query1, query2])

            record1 = [1.0, [12.0, 9.0]]  # Clipped to [1.0, [4.0, 3.0]]
            record2 = [5.0, [1.0, 2.0]]  # Clipped to [4.0, [1.0, 2.0]]

            query_result = _run_query(query, [record1, record2])
            result = sess.run(query_result)
            expected = [1.0, [1.0, 1.0]]
            self.assertAllClose(result, expected)
 def test_record_incompatible_with_query(self, queries, record, error_type):
     with self.assertRaises(error_type):
         _run_query(nested_query.NestedQuery(queries), [record])