Esempio n. 1
0
    def __call__(self, state, *args, **kwargs):
        """Performs the stateful function call.

    Args:
      state: A `tff.Value` placed on the `tff.SERVER`.
      *args: Arguments to the function.
      **kwargs: Arguments to the function.

    Returns:
       A tuple of `tff.Value`s (state@SERVER, ...) where
         * state: The updated state, to be passed to the next invocation
           of call.
         * ...: The result of the aggregation.
    """
        return self._next_fn(values.to_value(state), *args, **kwargs)
Esempio n. 2
0
 def one_arg_initialize(one_arg):
     del one_arg  # unused
     return values.to_value(0)
Esempio n. 3
0
 def test_to_value_with_int_constant(self):
     val = values.to_value(10)
     self.assertIsInstance(val, value_base.Value)
     self.assertEqual(str(val.type_signature), 'int32')