Skip to content

Commit

Permalink
Reset the simpler content for regression files
Browse files Browse the repository at this point in the history
Signed-off-by: Fabrice Normandin <normandf@mila.quebec>
  • Loading branch information
lebrice committed Nov 20, 2024
1 parent 62f7c5d commit 668086f
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 31 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
batch.list_index_0:
batch.0:
device: cuda:0
max: '2.126e+00'
mean: '-6.179e-03'
Expand All @@ -9,7 +9,7 @@ batch.list_index_0:
- 32
- 32
sum: '-2.43e+03'
batch.list_index_1:
batch.1:
device: cuda:0
max: 9
mean: '4.555e+00'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
batch.list_index_0:
batch.0:
device: cuda:0
max: '2.821e+00'
mean: '4.822e-01'
Expand All @@ -9,7 +9,7 @@ batch.list_index_0:
- 28
- 28
sum: '4.839e+04'
batch.list_index_1:
batch.1:
device: cuda:0
max: 9
mean: '4.555e+00'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
batch.list_index_0:
batch.0:
device: cuda:0
max: '2.640e+00'
mean: '3.701e-03'
Expand All @@ -9,7 +9,7 @@ batch.list_index_0:
- 32
- 32
sum: '7.277e+02'
batch.list_index_1:
batch.1:
device: cuda:0
max: 993
mean: '4.871e+02'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
batch.list_index_0:
batch.0:
device: cuda:0
max: '2.126e+00'
mean: '-6.179e-03'
Expand All @@ -9,7 +9,7 @@ batch.list_index_0:
- 32
- 32
sum: '-2.43e+03'
batch.list_index_1:
batch.1:
device: cuda:0
max: 9
mean: '4.555e+00'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
batch.list_index_0:
batch.0:
device: cuda:0
max: '2.640e+00'
mean: '3.701e-03'
Expand All @@ -9,7 +9,7 @@ batch.list_index_0:
- 32
- 32
sum: '7.277e+02'
batch.list_index_1:
batch.1:
device: cuda:0
max: 993
mean: '4.871e+02'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
batch.list_index_0:
batch.0:
device: cuda:0
max: '2.126e+00'
mean: '-6.179e-03'
Expand All @@ -9,7 +9,7 @@ batch.list_index_0:
- 32
- 32
sum: '-2.43e+03'
batch.list_index_1:
batch.1:
device: cuda:0
max: 9
mean: '4.555e+00'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
batch.list_index_0:
batch.0:
device: cuda:0
max: '2.640e+00'
mean: '3.701e-03'
Expand All @@ -9,7 +9,7 @@ batch.list_index_0:
- 32
- 32
sum: '7.277e+02'
batch.list_index_1:
batch.1:
device: cuda:0
max: 993
mean: '4.871e+02'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
batch.list_index_0:
batch.0:
device: cuda:0
max: '2.126e+00'
mean: '-6.179e-03'
Expand All @@ -9,7 +9,7 @@ batch.list_index_0:
- 32
- 32
sum: '-2.43e+03'
batch.list_index_1:
batch.1:
device: cuda:0
max: 9
mean: '4.555e+00'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
batch.list_index_0:
batch.0:
device: cuda:0
max: '2.126e+00'
mean: '-6.179e-03'
Expand All @@ -9,7 +9,7 @@ batch.list_index_0:
- 32
- 32
sum: '-2.43e+03'
batch.list_index_1:
batch.1:
device: cuda:0
max: 9
mean: '4.555e+00'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
batch.list_index_0:
batch.0:
device: cuda:0
max: '2.821e+00'
mean: '4.822e-01'
Expand All @@ -9,7 +9,7 @@ batch.list_index_0:
- 28
- 28
sum: '4.839e+04'
batch.list_index_1:
batch.1:
device: cuda:0
max: 9
mean: '4.555e+00'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
batch.list_index_0:
batch.0:
device: cuda:0
max: '2.821e+00'
mean: '4.822e-01'
Expand All @@ -9,7 +9,7 @@ batch.list_index_0:
- 28
- 28
sum: '4.839e+04'
batch.list_index_1:
batch.1:
device: cuda:0
max: 9
mean: '4.555e+00'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
batch.list_index_0:
batch.0:
device: cuda:0
max: '2.640e+00'
mean: '3.701e-03'
Expand All @@ -9,7 +9,7 @@ batch.list_index_0:
- 32
- 32
sum: '7.277e+02'
batch.list_index_1:
batch.1:
device: cuda:0
max: 993
mean: '4.871e+02'
Expand Down
13 changes: 6 additions & 7 deletions project/algorithms/testsuites/lightning_module_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,17 +369,16 @@ def convert_list_and_tuples_to_dicts(value: Any) -> Any:
"""Converts all lists and tuples in a nested structure to dictionaries.
>>> convert_list_and_tuples_to_dicts([1, 2, 3])
{'list_index_0': 1, 'list_index_1': 2, 'list_index_2': 3}
{'0': 1, '1': 2, '2': 3}
>>> convert_list_and_tuples_to_dicts((1, 2, 3))
{'tuple_index_0': 1, 'tuple_index_1': 2, 'tuple_index_2': 3}
{'0': 1, '1': 2, '2': 3}
>>> convert_list_and_tuples_to_dicts({"a": [1, 2, 3], "b": (4, 5, 6)})
{'a': {'list_index_0': 1, 'list_index_1': 2, 'list_index_2': 3}, 'b': {'tuple_index_0': 4, 'tuple_index_1': 5, 'tuple_index_2': 6}}
{'a': {'0': 1, '1': 2, '2': 3}, 'b': {'0': 4, '1': 5, '2': 6}}
"""
if isinstance(value, Mapping):
return {k: convert_list_and_tuples_to_dicts(v) for k, v in value.items()}
if isinstance(value, list | tuple):
return {
f"{type(value).__name__}_index_{i}": convert_list_and_tuples_to_dicts(v)
for i, v in enumerate(value)
}
# NOTE: Here we won't be able to distinguish between {"0": "bob"} and ["bob"]!
# But that's not too bad.
return {f"{i}": convert_list_and_tuples_to_dicts(v) for i, v in enumerate(value)}
return value

0 comments on commit 668086f

Please sign in to comment.