Skip to content

Commit 24ac2b3

Browse files
michaelreneercopybara-github
authored andcommitted
Remove unnecessary usage of structure module.
PiperOrigin-RevId: 746444765
1 parent c9047eb commit 24ac2b3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tensorflow_federated/python/core/backends/mapreduce/form_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,8 @@ def _as_function_of_some_federated_subparameters(
613613
py_typecheck.check_type(index, str)
614614
if not structure.has_field(selected_type, index):
615615
raise tree_transformations.ParameterSelectionError(path, bb)
616-
int_path.append(structure.name_to_index_map(selected_type)[index])
616+
names = [n for n, _ in selected_type.items()]
617+
int_path.append(names.index(index))
617618
selected_type = selected_type[index]
618619
if not isinstance(selected_type, federated_language.FederatedType):
619620
raise _NonFederatedSelectionError(

0 commit comments

Comments
 (0)