This project is mirrored from https://github.com/tensorflow/federated.
Pull mirroring failed .
Last successful update .
Last successful update .
- 05 Nov, 2020 1 commit
-
-
Michael Reneer authored
Do not use or import the ABCs from `collections`, this is deprecated since Python 3.3, and in 3.9 it will stop working. These ABCs have moved to 'collections.abc' and should be used from this package. PiperOrigin-RevId: 340678321
-
- 23 Oct, 2020 1 commit
-
-
Taylor Cramer authored
This also cleans up some other shared functionlity in form_utils and clarifies the ordering of (context_from_server, client_data) parameters in both broadcast-form-able computations and in `BroadcastForm.client_processing`. This aligns with `IterativeProcess`, but does not match `work`. PiperOrigin-RevId: 338553479
-
- 17 Oct, 2020 1 commit
-
-
Zachary Garrett authored
This enables support for Python 3.8, which changed behavior of `_asdict` to return regular `dict` types. https://docs.python.org/3/library/collections.html#collections.somenamedtuple._asdict PiperOrigin-RevId: 337559550
-
- 19 Aug, 2020 1 commit
-
-
Keith Rush authored
PiperOrigin-RevId: 327308706
-
- 24 Jul, 2020 1 commit
-
-
Taylor Cramer authored
Also migrates a handful of usage sites as necessary, and moves all users of `is_tuple` and co. to `is_struct`. PiperOrigin-RevId: 322865881
-
- 22 Jul, 2020 1 commit
-
-
Taylor Cramer authored
This change moves and renames `AnonymousTuple` and its `Type`-based brethren. It re-exports the new types under the old names to allow for a more gradual transition to the new API. PiperOrigin-RevId: 322477504
-
- 18 Jul, 2020 1 commit
-
-
Taylor Cramer authored
Previously, NamedTupleTypeWithPyContainerType was often lost and turned into a NamedTupleType without the container. This resulted in users being given AnonymousTuples when a more specific container should have been returned. This change fixes a large number of sites where container types were lost, and adjusts usage sites as appropriate, including the removal of `from_tff_result` functions. This change also makes the `__eq__` function for `NamedTupleTypeWithPyContainerType` require equivalent container types, rather than just equivalent field structure. Call sites that wished to compare only field structure are adjusted to use `Type.{is, check}_equivalent_to`. PiperOrigin-RevId: 321883012
-
- 24 Jun, 2020 1 commit
-
-
Michael Reneer authored
PiperOrigin-RevId: 317897580
-
- 23 Jun, 2020 1 commit
-
-
Taylor Cramer authored
These are modifications I made in order to speed up the workload timing out in serialization + deserialization in b/156371202. I intend to follow it with a change to intern types, whose serialization, deserialization, and comparison is currently causing exponential blowups due to the nested structure of type signatures and the frequency with which they occur throughout the AST (one full copy per node). The biggest change in this CL comes from the move away from using `isinstance` to case over AST blocks and type nodes. This change was motivated by a few factors: - It's significantly faster (a single method lookup vs. type tree traversal). - It clarifies which `isinstance` checks are dynamic Python "downcasts" vs. "switch"es on a kind of sum-type. The downcast-like spots are in my opinion more suspect and should be subject to a decent bit of scrutiny when added, while switches on a sum-type should not be cause for concern. - I personally find it more ergonomic and easier to read: `my_structure.is_lambda()` vs. `isinstance(my_structure, computation_types.Lambda)` Some other performance-motivated changes included here are: - Caching the list-of-tuples representation of AnonymousTuples. - Moving formatting of error messages out of the success path. - Removing the `are_equivalent_types` check on building blocks which ensured that the deserialized type of a building block matched the type of the deserialized building block. This check isn't exactly redundant, but given correct serialization and deserialization it will never trigger, and it is extremely expensive (expontentially complex). This may be worth looking into reenabling once I've landed a change to intern Types. - Removing the `check_well_formed` on building blocks __init__. This is similar to the above in that it should be unnecessary given correct TFF code, and is extremely expensive. As above, it may be worth trying to enable when we start interning types. - I did *not* disable the `is_concrete_instance_of` check on the `Intrinsic` building block, which is also quite expensive. I think this one is rather higher-value than the two above, but this is totally a judgement call as they are all quite costly and scale exponentially in time with the depth of the type tree. This should also hopefully be much cheaper once we have type interning. - Moving the type tree visitor to internal iteration. I did not do the same for the building block visitor yet, since it has more visitors of varied shape and complexity, but I think this is worth investigating in the future. PiperOrigin-RevId: 317769828
-
- 28 May, 2020 1 commit
-
-
Michael Reneer authored
PiperOrigin-RevId: 313413666
-
- 27 May, 2020 1 commit
-
-
Michael Reneer authored
Note that this change also refactors the construction of `building_block.Selection` so that initializing `super` happens before initializing the subclass state. Also note that `AnonymousTuple`'s require iteration or protected access to know if a key exists :(. PiperOrigin-RevId: 313390200
-
- 08 May, 2020 2 commits
-
-
Michael Reneer authored
Replace `import tensorflow.compat.v2 as tf` with `import tensorflow as tf` in the `common_libs` module. PiperOrigin-RevId: 310390622
-
Michael Reneer authored
PiperOrigin-RevId: 310377468
-
- 10 Mar, 2020 1 commit
-
-
Scott Wegner authored
This is a convenience for working with the output of a federated computation, which is generally returned as a nested AnonymousTuple structure. Now, individual values can be extracted from the structure using: result = my_federated_computation() pprint(result['foo']) This was previously possible using `getattr(result, 'foo')`; this change makes the existing functionality more discoverable. PiperOrigin-RevId: 299964819
-
- 08 Feb, 2020 1 commit
-
-
Taylor Cramer authored
This intrinsic is similar to federated_value, but accepts a no-argument lambda rather than an unplaced value. This will clarify the behavior of the intrinsic (eval on all clients separately rather than eval and then broadcast), and unblocks the effort to ban unplaced values. PiperOrigin-RevId: 293898477
-
- 03 Jan, 2020 1 commit
-
-
Michael Reneer authored
PiperOrigin-RevId: 287856859
-
- 31 Dec, 2019 2 commits
-
-
Michael Reneer authored
PiperOrigin-RevId: 287599572
-
Michael Reneer authored
PiperOrigin-RevId: 287587245
-
- 18 Dec, 2019 2 commits
-
-
Zachary Garrett authored
AnonymousTuple now accepts any iterable, including generators. This makes use of that functionality. PiperOrigin-RevId: 286089936
-
Zachary Garrett authored
PiperOrigin-RevId: 286036717
-
- 16 Nov, 2019 2 commits
-
-
A. Unique TensorFlower authored
PiperOrigin-RevId: 280784907
-
Michael Reneer authored
PiperOrigin-RevId: 280767713
-
- 15 Nov, 2019 1 commit
-
-
Zachary Garrett authored
Raise an error in anonymous_tuple.pack_sequence_as() instead of silently dropping sequence elements. PiperOrigin-RevId: 280448872
-
- 17 Oct, 2019 1 commit
-
-
Zachary Garrett authored
Note: the result of `__dir__` is sorted by Python and won't preserve ordering. PiperOrigin-RevId: 275252040
-
- 21 Sep, 2019 1 commit
-
-
Scott Wegner authored
* Add space between sentences * Improve wording around how may fields may be shown PiperOrigin-RevId: 270372166
-
- 12 Sep, 2019 1 commit
-
-
Keith Rush authored
Generates the elements of the tuple in sequence instead of pulling the entire thing into a list. Also replaces any instances of immediate iteration over the elements with iterating over the generator instead. PiperOrigin-RevId: 268550273
-
- 07 Sep, 2019 1 commit
-
-
Keith Rush authored
Previously, equality was checked by equality of name_to_index dict (IE equality as dicts, as unordered sets of key-value pairs), while hash was generated by iterating over the dict (where order matters). Since dicts are unordered, it is an implementation detail of the underlying Python whether equality as AnonymousTuples then implies equality of hashes. This is not quite in line with the python spec of hash, which states that objects which compare as equal *must* return the same hash value. PiperOrigin-RevId: 267644204
-
- 06 Sep, 2019 1 commit
-
-
Keith Rush authored
Previously this had to be constructed every time to_elements was called; now attached to the anonymous tuple itself, and without adding extra iteration over the element array. PiperOrigin-RevId: 267480998
-
- 29 Aug, 2019 1 commit
-
-
Michael Reneer authored
* Updated `__eq__` implementation. * Added more tests. PiperOrigin-RevId: 266080001
-
- 23 Aug, 2019 1 commit
-
-
A. Unique TensorFlower authored
PiperOrigin-RevId: 264872454
-
- 20 Aug, 2019 1 commit
-
-
Michael Reneer authored
PiperOrigin-RevId: 264257508
-
- 16 Aug, 2019 1 commit
-
-
Michael Reneer authored
* Removed explicit calls to `str`. * Updated to use `''.format()`. PiperOrigin-RevId: 263601586
-
- 02 Aug, 2019 1 commit
-
-
Brendan McMahan authored
Adds a utility to recursively convert AnonymousTuples to an arbitrary container type, and uses this to add a recursive kwarg to AnonymousTuple._asdict for returning a nested structure of OrderedDicts. PiperOrigin-RevId: 260811226
-
- 24 May, 2019 1 commit
-
-
Zachary Garrett authored
PiperOrigin-RevId: 249692405
-
- 16 May, 2019 1 commit
-
-
Michael Reneer authored
* Added `name_required` to allow for `None` names. * Added `value_type` to allow testing for value types. PiperOrigin-RevId: 248394238
-
- 15 May, 2019 1 commit
-
-
Zachary Garrett authored
PiperOrigin-RevId: 248151454
-
- 14 May, 2019 1 commit
-
-
Zachary Garrett authored
PiperOrigin-RevId: 247959670
-
- 13 May, 2019 1 commit
-
-
Zachary Garrett authored
PiperOrigin-RevId: 247944470
-
- 11 May, 2019 1 commit
-
-
Brendan McMahan authored
Add an _asdict method to AnonymousTuple. This should allow us to avoid importing anonymous_tuple in places where we need to convert the result of a federated comutation back into a standard Python container. PiperOrigin-RevId: 247674260
-
- 10 May, 2019 1 commit
-
-
Zachary Garrett authored
PiperOrigin-RevId: 247478369
-