Backend conversion from Database to DataProvider
In MNIST database, the image is loaded in a tensor with backend 'opencv'. The DataProvider require tensors of backend 'cpu' to stack several tensors into a tensor with a batch dimension. A convertion of tensor backend is required before the DataProvider get the tensor.
The current implementation uses a custom convertToCpu
Utils function that is called in the getItem
function of the database.
Instead, the convertion should be performed using the convert system enabled with the tensor new version aidge_core!57 (merged).
A simple setBackend('cpu') should be enough to switch the backend from opencv to cpu.
TO CHECK
Behaviour of 'opencv -> cpu' AND 'cpu -> opencv'. Given the fact that the TensorImpl_opencv stores a future_std::span<cv::Mat>
I think the case 'cpu -> opencv' will raise an error.