openfl.utilities.utils.change_tags

Contents

openfl.utilities.utils.change_tags#

openfl.utilities.utils.change_tags(tags, *, add_field=None, remove_field=None)[source]#

Change tensor tags to add or remove fields.

This function adds or removes fields from tensor tags.

Parameters:
  • tags (Tuple[str, ...]) – The tensor tags.

  • add_field (str, optional) – A new tensor tag field to add. Defaults to None.

  • remove_field (str, optional) – A tensor tag field to remove. Defaults to None.

Returns:

The modified tensor tags.

Return type:

Tuple[str, …]

Raises:

Exception – If remove_field is not in tags.