Virtual Devices#
Canaan#
Tensorflow#
- class neurio.devices.virtual.tensorflow.tflite.TFLiteVirtual(port: any, name: str = '', log_dir: str | None = None, options: dict = {'is_quantized': True})[source]#
- is_alive()[source]#
Check if the device is alive
- Parameters:
timeout – timeout in seconds
- Returns:
Return true if the device is alive (connected), false otherwise
- prepare_for_inference(model: Model, options: dict = {})[source]#
Prepare the device for inference. This function should be called before any inference.
- Parameters:
model – model to deploy on the device
kwargs – other parameters relevant for the preparation of the device
- predict(data: any, batch_size: int = 32, verbose: bool = True) Prediction [source]#
Predicts the data :param data: input data to predict :param batch_size: batch size for the prediction :param return_stats: return statistics of the prediction :param verbose: whether to print the progress bar :return: