MCPcopy Index your code
hub / github.com/pytorch/pytorch / GetContentFromProtoString

Function GetContentFromProtoString

caffe2/python/utils.py:227–235  ·  view source on GitHub ↗
(s, function_map)

Source from the content-addressed store, hash-verified

225
226
227def GetContentFromProtoString(s, function_map):
228 for cls, func in function_map.items():
229 try:
230 obj = TryReadProtoWithClass(cls, s)
231 return func(obj)
232 except DecodeError:
233 continue
234 else:
235 raise DecodeError("Cannot find a fit protobuffer class.")
236
237
238def ConvertProtoToBinary(proto_class, filename, out_filename):

Callers

nothing calls this directly

Calls 3

TryReadProtoWithClassFunction · 0.85
funcFunction · 0.70
itemsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…