diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2017-11-10 18:14:06 +0000 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:35:24 +0000 |
commit | 283c1790da45ab562ecfb2aa7741297191886d85 (patch) | |
tree | 45956bb79167e17aa634fd5f4d05c68ba059274c /arm_compute/core/Helpers.inl | |
parent | 624b77859dc9d0618056dad66833b9c37033337b (diff) | |
download | ComputeLibrary-283c1790da45ab562ecfb2aa7741297191886d85.tar.gz |
COMPMID-676: Rework TensorInfo building
Change-Id: Ic98f64ffe30739437a1fe31ef98d83ee900741e3
Reviewed-on: http://mpd-gerrit.cambridge.arm.com/95512
Reviewed-by: Michalis Spyrou <michalis.spyrou@arm.com>
Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'arm_compute/core/Helpers.inl')
-rw-r--r-- | arm_compute/core/Helpers.inl | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/arm_compute/core/Helpers.inl b/arm_compute/core/Helpers.inl index 656956d00a..1e565344b7 100644 --- a/arm_compute/core/Helpers.inl +++ b/arm_compute/core/Helpers.inl @@ -217,6 +217,21 @@ inline bool auto_init_if_empty(ITensorInfo &info, return false; } +inline bool auto_init_if_empty(ITensorInfo &info_sink, ITensorInfo &info_source) +{ + if(info_sink.tensor_shape().total_size() == 0) + { + info_sink.set_data_type(info_source.data_type()); + info_sink.set_num_channels(info_source.num_channels()); + info_sink.set_tensor_shape(info_source.tensor_shape()); + info_sink.set_fixed_point_position(info_source.fixed_point_position()); + info_sink.set_quantization_info(info_source.quantization_info()); + return true; + } + + return false; +} + inline bool set_shape_if_empty(ITensorInfo &info, const TensorShape &shape) { if(info.tensor_shape().total_size() == 0) |