File size: 317 Bytes
fb5159d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## @package serde
# Module caffe2.python.predictor.serde
def serialize_protobuf_struct(protobuf_struct):
return protobuf_struct.SerializeToString()
def deserialize_protobuf_struct(serialized_protobuf, struct_type):
deser = struct_type()
deser.ParseFromString(serialized_protobuf)
return deser
|