[mlpack-git] master: Add SFINAE pattern for the Weights, Reward and Location function. (491123b)

gitdub at mlpack.org gitdub at mlpack.org
Fri Feb 19 09:36:02 EST 2016


Repository : https://github.com/mlpack/mlpack
On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/8b187fcbf3ccb4607993d447445339729fdc1e49...491123bfa264636fd4e0d3079e16f0222ed231db

>---------------------------------------------------------------

commit 491123bfa264636fd4e0d3079e16f0222ed231db
Author: marcus <marcus.edel at fu-berlin.de>
Date:   Fri Feb 19 15:36:02 2016 +0100

    Add SFINAE pattern for the Weights, Reward and Location function.


>---------------------------------------------------------------

491123bfa264636fd4e0d3079e16f0222ed231db
 src/mlpack/methods/ann/layer/layer_traits.hpp | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/mlpack/methods/ann/layer/layer_traits.hpp b/src/mlpack/methods/ann/layer/layer_traits.hpp
index 3c07e7d..bebc2ad 100644
--- a/src/mlpack/methods/ann/layer/layer_traits.hpp
+++ b/src/mlpack/methods/ann/layer/layer_traits.hpp
@@ -68,6 +68,18 @@ HAS_MEM_FUNC(RecurrentParameter, HasRecurrentParameterCheck);
 // can use with SFINAE to catch when a type has a SeqLen() function.
 HAS_MEM_FUNC(SeqLen, HasSeqLenCheck);
 
+// This gives us a HasWeightsCheck<T, U> type (where U is a function pointer) we
+// can use with SFINAE to catch when a type has a Weights() function.
+HAS_MEM_FUNC(Weights, HasWeightsCheck);
+
+// This gives us a HasLocationCheck<T, U> type (where U is a function pointer)
+// we can use with SFINAE to catch when a type has a Location() function.
+HAS_MEM_FUNC(Location, HasLocationCheck);
+
+// This gives us a HasRewardCheck<T, U> type (where U is a function pointer) we
+// can use with SFINAE to catch when a type has a Reward() function.
+HAS_MEM_FUNC(Reward, HasRewardCheck);
+
 } // namespace ann
 } // namespace mlpack
 




More information about the mlpack-git mailing list