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

Function from_json

tools/Polygraphy/polygraphy/json/serde.py:267–280  ·  view source on GitHub ↗

Decode a JSON string to an object. NOTE: For Polygraphy objects, you should use the ``from_json()`` method instead. Args: src (str): The JSON representation of the object Returns: object: The decoded instance

(src)

Source from the content-addressed store, hash-verified

265@mod.export()
266@try_register_common_json
267def from_json(src):
268 """
269 Decode a JSON string to an object.
270
271 NOTE: For Polygraphy objects, you should use the ``from_json()`` method instead.
272
273 Args:
274 src (str):
275 The JSON representation of the object
276
277 Returns:
278 object: The decoded instance
279 """
280 return json.loads(src, object_pairs_hook=Decoder())
281
282
283@mod.export()

Callers 4

test_serdeMethod · 0.90
load_jsonFunction · 0.85
_from_json_methodFunction · 0.85

Calls 1

DecoderClass · 0.70

Tested by 2

test_serdeMethod · 0.72