MCPcopy Create free account
hub / github.com/NVIDIA/FasterTransformer / load_weights

Function load_weights

examples/tensorrt/vit/plugin_loader_int8.py:25–30  ·  view source on GitHub ↗
(weight_path:str)

Source from the content-addressed store, hash-verified

23import torch
24
25def load_weights(weight_path:str):
26 suffix = weight_path.split('.')[-1]
27 if suffix != 'pth':
28 print("Unsupported weight file: Unrecognized format %s " % suffix)
29 exit(-1)
30 return torch.load(weight_path, map_location="cpu")
31
32class ViTINT8PluginLoader:
33 def __init__(self, plugin_path) -> None:

Callers

nothing calls this directly

Calls 1

loadMethod · 0.45

Tested by

no test coverage detected