From 94fb98c906e6ef3bb65824ff9487b5db14d9e5b7 Mon Sep 17 00:00:00 2001 From: leej3 Date: Tue, 18 Jun 2024 15:10:55 +0100 Subject: [PATCH] fixup --- ignite/utils.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/ignite/utils.py b/ignite/utils.py index a492a5e38723..f90d23c89483 100644 --- a/ignite/utils.py +++ b/ignite/utils.py @@ -103,8 +103,10 @@ 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. @@ -112,14 +114,14 @@ def flatten_format_and_include_keys(data: Any) -> List[str]: - 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