From 8d94269d7985b9cee67e52581e2f58b6c99d7f0d Mon Sep 17 00:00:00 2001 From: John Kesapides Date: Tue, 26 Feb 2019 14:52:12 +0000 Subject: COMPMID-1492 Create tests/validate_examples/graph_depthwise_convolution Add new validate graph example and unify common example code Change-Id: Ibfd7ae2067ad805d6c82d953fe3febfbea961149 Signed-off-by: John Kesapides Reviewed-on: https://review.mlplatform.org/c/825 Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins Reviewed-by: Georgios Pinitas --- src/graph/TypeLoader.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src') diff --git a/src/graph/TypeLoader.cpp b/src/graph/TypeLoader.cpp index 0c1ce25b92..b63672b39b 100644 --- a/src/graph/TypeLoader.cpp +++ b/src/graph/TypeLoader.cpp @@ -125,5 +125,30 @@ ConvolutionMethod Convolution_method_from_name(const std::string &name) } #endif /* ARM_COMPUTE_EXCEPTIONS_DISABLED */ } + +DepthwiseConvolutionMethod depthwise_convolution_method_from_name(const std::string &name) +{ + static const std::map methods = + { + { "default", DepthwiseConvolutionMethod::Default }, + { "gemv", DepthwiseConvolutionMethod::GEMV }, + { "optimized3x3", DepthwiseConvolutionMethod::Optimized3x3 }, + }; + +#ifndef ARM_COMPUTE_EXCEPTIONS_DISABLED + try + { +#endif /* ARM_COMPUTE_EXCEPTIONS_DISABLED */ + return methods.at(arm_compute::utility::tolower(name)); + +#ifndef ARM_COMPUTE_EXCEPTIONS_DISABLED + } + catch(const std::out_of_range &) + { + throw std::invalid_argument(name); + } +#endif /* ARM_COMPUTE_EXCEPTIONS_DISABLED */ +} + } // namespace graph } // namespace arm_compute -- cgit v1.2.1