MCPcopy Create free account
hub / github.com/pytorch/pytorch / parse_kwarg

Function parse_kwarg

caffe2/python/benchmark_generator.py:18–27  ·  view source on GitHub ↗
(kwarg_str)

Source from the content-addressed store, hash-verified

16
17
18def parse_kwarg(kwarg_str):
19 key, value = map(string.strip, kwarg_str.split("=", 1))
20 try:
21 value = int(value)
22 except ValueError:
23 try:
24 value = float(value)
25 except ValueError:
26 pass
27 return key, value
28
29
30def main(args):

Callers

nothing calls this directly

Calls 1

splitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…