Example #1
0
 def __getstate__(self):
     """
     :epkg:`pickle` does not support functions.
     This method removes any link to function
     when the runtime is `'numpy'`.
     """
     state = BaseEstimator.__getstate__(self)
     if 'numpy_code_' in state:
         del state['onnxrt_']
     return state
Example #2
0
 def __getstate__(self):
     state = BaseEstimator.__getstate__(self)
     del state['sess_']
     state['onnx_'] = state['onnx_'].SerializeToString()
     return state