diff options
author | John Kesapides <john.kesapides@arm.com> | 2019-02-26 14:52:12 +0000 |
---|---|---|
committer | John Kesapides <john.kesapides@arm.com> | 2019-04-10 10:42:53 +0000 |
commit | 8d94269d7985b9cee67e52581e2f58b6c99d7f0d (patch) | |
tree | 33d12c8ae7a6de559dae4a12f240b2e228cfe3ef /src/graph/TypeLoader.cpp | |
parent | 165308cf6904f800206217ad2f09b8e5c8d5c286 (diff) | |
download | ComputeLibrary-8d94269d7985b9cee67e52581e2f58b6c99d7f0d.tar.gz |
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 <john.kesapides@arm.com>
Reviewed-on: https://review.mlplatform.org/c/825
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'src/graph/TypeLoader.cpp')
-rw-r--r-- | src/graph/TypeLoader.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
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<std::string, DepthwiseConvolutionMethod> 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 |