diff options
author | Usama Arif <usama.arif@arm.com> | 2019-04-08 17:30:48 +0100 |
---|---|---|
committer | Pablo Marquez <pablo.tello@arm.com> | 2019-04-18 10:07:37 +0000 |
commit | e73686ac797be2d19cd9bed26d690e1431e3d848 (patch) | |
tree | 84a65c520b3a7b3e0abef03b48f8bbc0882e1fa4 /tests/datasets/DepthwiseConvolutionLayerDataset.h | |
parent | 6631ac22efdb75438e8f35e836ae9f17cfd40c86 (diff) | |
download | ComputeLibrary-e73686ac797be2d19cd9bed26d690e1431e3d848.tar.gz |
COMPMID-2047: Add support for dilation in CLDepthwiseConvolution.
Change-Id: I3106aa34bd168985a56791613d95072756be6e9b
Signed-off-by: Usama Arif <usama.arif@arm.com>
Reviewed-on: https://review.mlplatform.org/c/958
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Pablo Marquez <pablo.tello@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'tests/datasets/DepthwiseConvolutionLayerDataset.h')
-rw-r--r-- | tests/datasets/DepthwiseConvolutionLayerDataset.h | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/tests/datasets/DepthwiseConvolutionLayerDataset.h b/tests/datasets/DepthwiseConvolutionLayerDataset.h index 8a1f3b6f39..4c78eb87ea 100644 --- a/tests/datasets/DepthwiseConvolutionLayerDataset.h +++ b/tests/datasets/DepthwiseConvolutionLayerDataset.h @@ -38,16 +38,18 @@ namespace datasets class DepthwiseConvolutionLayerDataset { public: - using type = std::tuple<TensorShape, Size2D, PadStrideInfo>; + using type = std::tuple<TensorShape, Size2D, PadStrideInfo, Size2D>; struct iterator { iterator(std::vector<TensorShape>::const_iterator src_it, std::vector<Size2D>::const_iterator weights_it, - std::vector<PadStrideInfo>::const_iterator infos_it) + std::vector<PadStrideInfo>::const_iterator infos_it, + std::vector<Size2D>::const_iterator dilation_it) : _src_it{ std::move(src_it) }, _weights_it{ std::move(weights_it) }, - _infos_it{ std::move(infos_it) } + _infos_it{ std::move(infos_it) }, + _dilation_it{ std::move(dilation_it) } { } @@ -56,13 +58,14 @@ public: std::stringstream description; description << "In=" << *_src_it << ":"; description << "Weights=" << *_weights_it << ":"; - description << "Info=" << *_infos_it; + description << "Info=" << *_infos_it << ":"; + description << "Dilation=" << *_dilation_it; return description.str(); } DepthwiseConvolutionLayerDataset::type operator*() const { - return std::make_tuple(*_src_it, *_weights_it, *_infos_it); + return std::make_tuple(*_src_it, *_weights_it, *_infos_it, *_dilation_it); } iterator &operator++() @@ -70,6 +73,7 @@ public: ++_src_it; ++_weights_it; ++_infos_it; + ++_dilation_it; return *this; } @@ -78,23 +82,25 @@ public: std::vector<TensorShape>::const_iterator _src_it; std::vector<Size2D>::const_iterator _weights_it; std::vector<PadStrideInfo>::const_iterator _infos_it; + std::vector<Size2D>::const_iterator _dilation_it; }; iterator begin() const { - return iterator(_src_shapes.begin(), _weight_shapes.begin(), _infos.begin()); + return iterator(_src_shapes.begin(), _weight_shapes.begin(), _infos.begin(), _dilations.begin()); } int size() const { - return std::min(_src_shapes.size(), std::min(_weight_shapes.size(), _infos.size())); + return std::min(_src_shapes.size(), std::min(_weight_shapes.size(), std::min(_infos.size(), _dilations.size()))); } - void add_config(TensorShape src, Size2D weights, PadStrideInfo info) + void add_config(TensorShape src, Size2D weights, PadStrideInfo info, Size2D dilation = Size2D(1U, 1U)) { _src_shapes.emplace_back(std::move(src)); _weight_shapes.emplace_back(std::move(weights)); _infos.emplace_back(std::move(info)); + _dilations.emplace_back(std::move(dilation)); } protected: @@ -105,6 +111,7 @@ private: std::vector<TensorShape> _src_shapes{}; std::vector<Size2D> _weight_shapes{}; std::vector<PadStrideInfo> _infos{}; + std::vector<Size2D> _dilations{}; }; /** Dataset containing small, generic depthwise convolution shapes. */ |