litecow.common package¶
Submodules¶
litecow.common.common module¶
- litecow.common.common.prepare_array(array: numpy.ndarray) → litecow.common.litecow_pb2.Array¶
Convert a numpy array to a litecow array
- Parameters
array (np.ndarray) – Array to convert
- Returns
- Return type
- litecow.common.common.prepare_array_list(arrays: List[numpy.ndarray]) → litecow.common.litecow_pb2.ArrayList¶
Convert a list of numpy arrays to a litecow ArrayList
- Parameters
arrays (List[np.ndarray]) – Arrays to convert to litecow ArrayList
- Returns
- Return type
- litecow.common.common.prepare_named_arrays(named_arrays: Dict[str, numpy.ndarray]) → litecow.common.litecow_pb2.NamedArrays¶
Convert a dictionary of arrays to a litecow NamedArrays
- Parameters
named_arrays (Dict[str, np.ndarray]) – Dictionary mapping string names to numpy arrays
- Returns
- Return type
- litecow.common.common.unprepare_array(array: litecow.common.litecow_pb2.Array) → numpy.ndarray¶
Convert a litecow Array to a numpy array
- Parameters
array (litecow.common.litecow_pb2.Array) – Array to convert back to numpy array
- Returns
- Return type
np.ndarray
- litecow.common.common.unprepare_array_list(arrays: litecow.common.litecow_pb2.ArrayList) → List[numpy.ndarray]¶
Convert litecow ArrayList back to a list of numpy arrays
- Parameters
arrays (litecow.common.litecow_pb2.ArrayList) – ArrayList to convert.
- Returns
- Return type
List[np.ndarray]
- litecow.common.common.unprepare_named_arrays(named_arrays: litecow.common.litecow_pb2.NamedArrays) → Dict[str, numpy.ndarray]¶
Convert litecow NamedArrays back to a dictionary of numpy arrays
- Parameters
named_arrays (litecow.common.litecow_pb2.NamedArrays) – NamedArrays to convert
- Returns
- Return type
Dict[str, np.ndarray]
litecow.common.litecow_pb2 module¶
Generated protocol buffer code.
- class litecow.common.litecow_pb2.Array¶
Bases:
google.protobuf.pyext._message.CMessage
,google.protobuf.message.Message
- DESCRIPTOR = <google.protobuf.pyext._message.MessageDescriptor object>¶
The
google.protobuf.descriptor.Descriptor
for this message type.
- double_array¶
Field Array.double_array
- float_array¶
Field Array.float_array
- int32_array¶
Field Array.int32_array
- int64_array¶
Field Array.int64_array
- shape¶
Field Array.shape
- class litecow.common.litecow_pb2.ArrayList¶
Bases:
google.protobuf.pyext._message.CMessage
,google.protobuf.message.Message
- DESCRIPTOR = <google.protobuf.pyext._message.MessageDescriptor object>¶
The
google.protobuf.descriptor.Descriptor
for this message type.
- arrays¶
Field ArrayList.arrays
- class litecow.common.litecow_pb2.DoubleArray¶
Bases:
google.protobuf.pyext._message.CMessage
,google.protobuf.message.Message
- DESCRIPTOR = <google.protobuf.pyext._message.MessageDescriptor object>¶
The
google.protobuf.descriptor.Descriptor
for this message type.
- values¶
Field DoubleArray.values
- class litecow.common.litecow_pb2.FloatArray¶
Bases:
google.protobuf.pyext._message.CMessage
,google.protobuf.message.Message
- DESCRIPTOR = <google.protobuf.pyext._message.MessageDescriptor object>¶
The
google.protobuf.descriptor.Descriptor
for this message type.
- values¶
Field FloatArray.values
- class litecow.common.litecow_pb2.InferenceRequest¶
Bases:
google.protobuf.pyext._message.CMessage
,google.protobuf.message.Message
- DESCRIPTOR = <google.protobuf.pyext._message.MessageDescriptor object>¶
The
google.protobuf.descriptor.Descriptor
for this message type.
- model_key¶
Field InferenceRequest.model_key
- model_version¶
Field InferenceRequest.model_version
- named_inputs¶
Field InferenceRequest.named_inputs
- outputs¶
Field InferenceRequest.outputs
- unnamed_inputs¶
Field InferenceRequest.unnamed_inputs
- class litecow.common.litecow_pb2.Int32Array¶
Bases:
google.protobuf.pyext._message.CMessage
,google.protobuf.message.Message
- DESCRIPTOR = <google.protobuf.pyext._message.MessageDescriptor object>¶
The
google.protobuf.descriptor.Descriptor
for this message type.
- values¶
Field Int32Array.values
- class litecow.common.litecow_pb2.Int64Array¶
Bases:
google.protobuf.pyext._message.CMessage
,google.protobuf.message.Message
- DESCRIPTOR = <google.protobuf.pyext._message.MessageDescriptor object>¶
The
google.protobuf.descriptor.Descriptor
for this message type.
- values¶
Field Int64Array.values
- class litecow.common.litecow_pb2.NamedArrays¶
Bases:
google.protobuf.pyext._message.CMessage
,google.protobuf.message.Message
- DESCRIPTOR = <google.protobuf.pyext._message.MessageDescriptor object>¶
The
google.protobuf.descriptor.Descriptor
for this message type.
- class NameToArrayEntry¶
Bases:
google.protobuf.pyext._message.CMessage
,google.protobuf.message.Message
- DESCRIPTOR = <google.protobuf.pyext._message.MessageDescriptor object>¶
The
google.protobuf.descriptor.Descriptor
for this message type.
- key¶
Field NamedArrays.NameToArrayEntry.key
- value¶
Field NamedArrays.NameToArrayEntry.value
- name_to_array¶
Field NamedArrays.name_to_array
litecow.common.litecow_pb2_grpc module¶
Client and server classes corresponding to protobuf-defined services.
- class litecow.common.litecow_pb2_grpc.ICOW¶
Bases:
object
Inference with Collected Onnx Weights service definition
- static get_inference(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None)¶
- class litecow.common.litecow_pb2_grpc.ICOWServicer¶
Bases:
object
Inference with Collected Onnx Weights service definition
- get_inference(request, context)¶
get inference
- class litecow.common.litecow_pb2_grpc.ICOWStub(channel)¶
Bases:
object
Inference with Collected Onnx Weights service definition
- litecow.common.litecow_pb2_grpc.add_ICOWServicer_to_server(servicer, server)¶