예제 #1
0
  def test_no_privacy_sum(self):
    with self.cached_session() as sess:
      record1 = tf.constant([2.0, 0.0])
      record2 = tf.constant([-1.0, 1.0])

      query = no_privacy_query.NoPrivacySumQuery()
      query_result, _ = test_utils.run_query(query, [record1, record2])
      result = sess.run(query_result)
      expected = [1.0, 1.0]
      self.assertAllClose(result, expected)
예제 #2
0
 def test_incompatible_records(self, record1, record2, error_type):
   query = no_privacy_query.NoPrivacySumQuery()
   with self.assertRaises(error_type):
     test_utils.run_query(query, [record1, record2])