CUDA Tensor are hard to get
When trying to print or accessing a value in a CUDA Tensor we first have to set its backend to CPU otherwise we just get a Segfault because we try to access a value using a pointer valid for the GPU and not for the CPU
This raise two issues:
- The error message is not clear for the user
- A mecanism should be done to automatically pull data to the host when trying to access values in order to avoid this behavior.
Currently, to read the output of agraph with the CUDA backend you have to do:
for outNode in graph.get_output_nodes():
output_aidge = outNode.get_operator().get_output(0)
output_aidge.set_backend('cpu')
print(np.array(output_aidge))