Caffe2 - Python API
A deep learning, cross platform ML framework
serde.py
1 ## @package serde
2 # Module caffe2.python.predictor.serde
3 from __future__ import absolute_import
4 from __future__ import division
5 from __future__ import print_function
6 from __future__ import unicode_literals
7 
8 
9 def serialize_protobuf_struct(protobuf_struct):
10  return protobuf_struct.SerializeToString()
11 
12 
13 def deserialize_protobuf_struct(serialized_protobuf, struct_type):
14  deser = struct_type()
15  deser.ParseFromString(serialized_protobuf)
16  return deser