ComputeLibrary icon indicating copy to clipboard operation
ComputeLibrary copied to clipboard

Input layer to have multiple images (batchs)

Open krgor opened this issue 6 years ago • 3 comments

I am using ACL 20.02 on Android 8.1 platform with Graph APIs.

I have a generic question where I want to use InputLayer() with variable number of images. The InputLayer should have tensor shape like below: const TensorShape tensor_shape = permute_shape(TensorShape(3U, 24U, 24U, mDim), DataLayout::NHWC, common_params.data_layout);

Here mDim is decided on runtime. As we have to define the mDim at the time of setup, currently we need to create multiple graph instances with different mDim values.

We have similar implementation in TensorFlow or OpenCV and we can mention unknown dimension with "-1" and it is decided at runtime [ like (3, 24, 24, -1)].

Do we have any implementation handle variable number of Images at runtime in ACL graph APIs, so that we need to have only one graph instance and can be used with different number of images?

krgor avatar Apr 08 '20 17:04 krgor

Hi @krgor

Thanks for your question.

With the current implementation of ACL graph API, your understanding that mDim have to be defined at the time of calling setup() is correct. In other words, unfortunately, ACL graph API currently doesn't support dynamic input size during run-time without calling setup() prior to every execution of the graph (which wouldn't be practical for measuring performance).

I hope it helps.

Thanks.

sanpar02 avatar Apr 09 '20 09:04 sanpar02

Hi @sanpar02

Thanks for the update. Can this be considered as a feature request and make it available in upcoming release?

Thanks, krgor

krgor avatar Apr 12 '20 08:04 krgor

Hello @krgor ,

This is not just a limitation in the graph API but in Compute Library in general. We do not support dynamic tensor yet. We are aware of this and we are planning it. Thank you for reporting.

George

GeorgeARM avatar May 01 '20 09:05 GeorgeARM