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

Class BytesFromPath

tools/Polygraphy/polygraphy/backend/common/loader.py:22–42  ·  view source on GitHub ↗

Functor that can load a file in binary mode ('rb').

Source from the content-addressed store, hash-verified

20
21@mod.export(funcify=True)
22class BytesFromPath(BaseLoader):
23 """
24 Functor that can load a file in binary mode ('rb').
25 """
26
27 def __init__(self, path):
28 """
29 Loads a file in binary mode ('rb').
30
31 Args:
32 path (str): The file path.
33 """
34 self._path = path
35
36 @util.check_called_by("__call__")
37 def call_impl(self):
38 """
39 Returns:
40 bytes: The contents of the file.
41 """
42 return util.load_file(self._path, description="bytes")
43
44
45@mod.export(funcify=True)

Callers 2

check_engineMethod · 0.90
mainFunction · 0.90

Calls

no outgoing calls

Tested by 1

check_engineMethod · 0.72