def test_sum_from_model(self): model_fn = model_examples.LinearRegression with warnings.catch_warnings(record=True) as w: warnings.simplefilter('always') gather_fn = encoding_utils.build_encoded_sum_from_model( model_fn, _test_encoder_fn('gather')) self.assertLen(w, 2) self.assertIsInstance(gather_fn, computation_utils.StatefulAggregateFn)
def test_sum_from_model(self): model_fn = model_examples.LinearRegression gather_fn = encoding_utils.build_encoded_sum_from_model( model_fn, _test_encoder_fn('gather')) self.assertIsInstance(gather_fn, tff.utils.StatefulAggregateFn)