Skip to content

Commit 91148b3

Browse files
committed
add none
1 parent ec103a4 commit 91148b3

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

CHANGELOGS.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Change Logs
22
===========
33

4+
0.4.2
5+
+++++
6+
7+
* :pr:`73`: supports MambaCache in max_diff, torch_deepcopy
8+
49
0.4.1
510
+++++
611

_unittests/ut_helpers/test_torch_test_helper.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@ def test_torch_deepcopy_sliding_windon_cache(self):
151151
hash2 = string_type(at, with_shape=True, with_min_max=True)
152152
self.assertEqual(hash1, hash2)
153153

154+
def test_torch_deepcopy_none(self):
155+
self.assertEmpty(torch_deepcopy(None))
156+
154157

155158
if __name__ == "__main__":
156159
unittest.main(verbosity=2)

onnx_diagnostic/helpers/torch_test_helper.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,8 @@ def torch_deepcopy(value: Any) -> Any:
347347
"""
348348
Makes a deepcopy.
349349
"""
350+
if value is None:
351+
return None
350352
if isinstance(value, (int, float, str)):
351353
return value
352354
if isinstance(value, tuple):

0 commit comments

Comments
 (0)