MCPcopy Create free account
hub / github.com/pytorch/executorch / InputListParser

Class InputListParser

examples/qualcomm/util_scripts/cli.py:139–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137
138
139class InputListParser:
140 def __init__(self, input_list):
141 self.input_list = input_list
142
143 def __iter__(self):
144 with open(self.input_list, "r") as f:
145 for line in re.split(r"\r?\n", f.read()):
146 if not line:
147 continue
148 split_line = line.strip().split(" ")
149 inputs = {}
150 if ":=" in line:
151 for input_assignment in split_line:
152 name, path = input_assignment.split(":=")
153 inputs[name] = torch.load(path, weights_only=True)
154 else:
155 inputs = [torch.load(t, weights_only=True) for t in split_line]
156 yield inputs
157
158
159def quantize(args):

Callers 2

quantizeFunction · 0.85
executeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected