in gen-py/config/ttypes.py [0:0]
def read(self, iprot):
self.field = 0
self.value = None
if (isinstance(iprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None:
fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, True], utf8strings=UTF8STRINGS, protoid=0)
self.checkRequired()
return
if (isinstance(iprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None:
fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, True], utf8strings=UTF8STRINGS, protoid=2)
self.checkRequired()
return
iprot.readStructBegin()
while True:
(fname, ftype, fid) = iprot.readFieldBegin()
if ftype == TType.STOP:
break
if fid == 1:
if ftype == TType.STRUCT:
sgd = SGDOptimConfig()
sgd.read(iprot)
assert self.field == 0 and self.value is None
self.set_sgd(sgd)
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.STRUCT:
adagrad = AdagradOptimConfig()
adagrad.read(iprot)
assert self.field == 0 and self.value is None
self.set_adagrad(adagrad)
else:
iprot.skip(ftype)
elif fid == 3:
if ftype == TType.STRUCT:
sparse_adam = SparseAdamOptimConfig()
sparse_adam.read(iprot)
assert self.field == 0 and self.value is None
self.set_sparse_adam(sparse_adam)
else:
iprot.skip(ftype)
elif fid == 4:
if ftype == TType.STRUCT:
adam = AdamOptimConfig()
adam.read(iprot)
assert self.field == 0 and self.value is None
self.set_adam(adam)
else:
iprot.skip(ftype)
elif fid == 5:
if ftype == TType.STRUCT:
rmsprop = RMSpropOptimConfig()
rmsprop.read(iprot)
assert self.field == 0 and self.value is None
self.set_rmsprop(rmsprop)
else:
iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()