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

Method set_data_loader

tools/Polygraphy/polygraphy/tools/script.py:296–313  ·  view source on GitHub ↗

Adds a data loader to this script, overwriting any previous data loader. Args: data_loader_str (str): A string constructing the data loader. Returns: str: The name of the data loader in the script, or None if the prov

(self, data_loader_str)

Source from the content-addressed store, hash-verified

294 self.imports[frm].update({(imp, imp_as) for imp in imports})
295
296 def set_data_loader(self, data_loader_str):
297 """
298 Adds a data loader to this script, overwriting any previous data loader.
299
300 Args:
301 data_loader_str (str): A string constructing the data loader.
302
303 Returns:
304 str:
305 The name of the data loader in the script, or None if the
306 provided data loader is empty.
307 """
308 if not data_loader_str:
309 return None
310 data_loader_str = ensure_safe(data_loader_str).unwrap()
311
312 self.data_loader = data_loader_str
313 return Script.DATA_LOADER_NAME
314
315 def add_loader(self, loader_str, loader_id):
316 """

Callers 1

_add_to_script_helperMethod · 0.80

Calls 2

ensure_safeFunction · 0.85
unwrapMethod · 0.80

Tested by

no test coverage detected