I would like to fill this tensor
int len_N[] = {4,4,4,4,4,4,4,4,4,2};
with random values for all but the last dimension and with two values (say 0 and 1) for the last dimension. I know how to do it with write, but I'm (very) concerned about the memory footprint of the code.
What is the least memory hungry approach?
Thanks!