Propagate container_type and include it in type equality checks.
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
Showing
- tensorflow_federated/python/common_libs/anonymous_tuple.py 2 additions, 2 deletionstensorflow_federated/python/common_libs/anonymous_tuple.py
- tensorflow_federated/python/core/__init__.py 1 addition, 0 deletionstensorflow_federated/python/core/__init__.py
- tensorflow_federated/python/core/api/__init__.py 1 addition, 0 deletionstensorflow_federated/python/core/api/__init__.py
- tensorflow_federated/python/core/api/computation_types.py 66 additions, 10 deletionstensorflow_federated/python/core/api/computation_types.py
- tensorflow_federated/python/core/api/computation_types_test.py 15 additions, 6 deletions...rflow_federated/python/core/api/computation_types_test.py
- tensorflow_federated/python/core/backends/mapreduce/canonical_form.py 24 additions, 11 deletions...ederated/python/core/backends/mapreduce/canonical_form.py
- tensorflow_federated/python/core/backends/mapreduce/canonical_form_utils.py 1 addition, 1 deletion...ed/python/core/backends/mapreduce/canonical_form_utils.py
- tensorflow_federated/python/core/impl/BUILD 1 addition, 1 deletiontensorflow_federated/python/core/impl/BUILD
- tensorflow_federated/python/core/impl/compiler/BUILD 6 additions, 6 deletionstensorflow_federated/python/core/impl/compiler/BUILD
- tensorflow_federated/python/core/impl/compiler/building_block_factory.py 54 additions, 16 deletions...rated/python/core/impl/compiler/building_block_factory.py
- tensorflow_federated/python/core/impl/compiler/building_block_factory_test.py 37 additions, 15 deletions.../python/core/impl/compiler/building_block_factory_test.py
- tensorflow_federated/python/core/impl/compiler/building_blocks.py 23 additions, 9 deletions...ow_federated/python/core/impl/compiler/building_blocks.py
- tensorflow_federated/python/core/impl/compiler/building_blocks_test.py 25 additions, 12 deletions...derated/python/core/impl/compiler/building_blocks_test.py
- tensorflow_federated/python/core/impl/compiler/compiled_computation_transforms_test.py 75 additions, 37 deletions...ore/impl/compiler/compiled_computation_transforms_test.py
- tensorflow_federated/python/core/impl/compiler/computation_factory_test.py 2 additions, 1 deletion...ted/python/core/impl/compiler/computation_factory_test.py
- tensorflow_federated/python/core/impl/compiler/tensorflow_computation_factory.py 3 additions, 2 deletions...thon/core/impl/compiler/tensorflow_computation_factory.py
- tensorflow_federated/python/core/impl/compiler/tensorflow_computation_factory_test.py 4 additions, 4 deletions...core/impl/compiler/tensorflow_computation_factory_test.py
- tensorflow_federated/python/core/impl/compiler/transformations_test.py 12 additions, 6 deletions...derated/python/core/impl/compiler/transformations_test.py
- tensorflow_federated/python/core/impl/compiler/tree_transformations_test.py 4 additions, 2 deletions...ed/python/core/impl/compiler/tree_transformations_test.py
- tensorflow_federated/python/core/impl/computation_impl.py 7 additions, 5 deletionstensorflow_federated/python/core/impl/computation_impl.py
Loading
Please register or sign in to comment