0

I declared a buffer of vector in c++:

boost::circular_buffer<std::vector<float>> poses {20};

I need to store the values of the buffer into a tensor of shape [1, 20, 30]. Each vector in the buffer is of size 30. So the circular buffer has 20 size with each buffer having 30 values.

How do I store values in the buffer to tensor at once?

sehe
  • 374,641
  • 47
  • 450
  • 633
  • For *at once*, meaning at the same time, you'll need multiple processors or cores and maybe some threads. If you have multiple address and data buses, you may be able to do this. The problem with modern computers is that there is usually only one data bus and one address bus. Thus entities need to share it. So multiple accesses to memory won't occur *at the same time*. I recommend researching your processor to see how it can load it data cache "at the same time"; also see if your platform has DMA, so that memory transfers can occur in the background. – Thomas Matthews Oct 19 '21 at 16:27
  • 2
    What does the "tensor" look like? What is the _type_ of it? – sehe Oct 19 '21 at 22:21
  • Is this a concurrency problem like Thomas is suggesting or just a problem of not knowing how to access some variables? What did you try and what were the obstacles you faced? – David Grayson Oct 19 '21 at 22:25
  • Why are you using a circular buffer if you don't want to use it as such? – Phil1970 Oct 19 '21 at 22:57
  • What datatype of your tensor? i.e. tensorflow, torch etc. – Victor Gubin Oct 20 '21 at 07:58

0 Answers0