MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT / test_serde

Method test_serde

tools/Polygraphy/tests/util/test_serde.py:122–128  ·  view source on GitHub ↗
(self, obj)

Source from the content-addressed store, hash-verified

120 ids=lambda x: type(x),
121 )
122 def test_serde(self, obj):
123 encoded = to_json(obj)
124 decoded = from_json(encoded)
125 if isinstance(obj, np.ndarray):
126 assert np.array_equal(decoded, obj)
127 else:
128 assert decoded == obj
129
130 @pytest.mark.parametrize("obj", JSONABLE_CASES)
131 def test_to_from_json(self, obj):

Callers

nothing calls this directly

Calls 2

to_jsonFunction · 0.90
from_jsonFunction · 0.90

Tested by

no test coverage detected