Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
leej3 committed Jun 18, 2024
1 parent 79c02e4 commit 94fb98c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions ignite/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,23 +103,25 @@ def flatten_format_and_include_keys(data: Any) -> List[str]:
debugging, or any scenario where a human-readable representation of complex,
nested data structures is required.
The function handles the following types: - Numbers: Formatted to four
decimal places. - PyTorch tensors:
The function handles the following types:
- Numbers: Formatted to four decimal places.
- PyTorch tensors:
- Scalars are formatted to four decimal places.
- 1D tensors with more than 10 elements show the first 10 elements
followed by an ellipsis.
- 1D tensors with 10 or fewer elements are fully listed.
- Multi-dimensional tensors display their shape.
- Dictionaries: Each key-value pair is included in the output with the key
as a prefix.
- Lists and tuples: Flattened and included in the output. Empty lists/tuples
are represented by an empty string.
- Lists and tuples: Flattened and included in the output. Empty lists/tuples are represented
by an empty string.
- None values: Represented by an empty string.
Args:
data: The input data to be flattened and formatted. It can be a nested
combination of dictionaries, lists, tuples, numbers, and PyTorch
tensors.
combination of dictionaries, lists, tuples, numbers, and PyTorch
tensors.
Returns:
A list of formatted strings, each representing a part of the input data
Expand Down

0 comments on commit 94fb98c

Please sign in to comment.