mlpack
input_shape_visitor.hpp
Go to the documentation of this file.
1 
15 #ifndef MLPACK_METHODS_ANN_VISITOR_INPUT_SHAPE_VISITOR_HPP
16 #define MLPACK_METHODS_ANN_VISITOR_INPUT_SHAPE_VISITOR_HPP
17 
20 
21 #include <boost/variant.hpp>
22 
23 namespace mlpack {
24 namespace ann {
25 
29 class InShapeVisitor : public boost::static_visitor<size_t>
30 {
31  public:
33  template<typename LayerType>
34  size_t operator()(LayerType* layer) const;
35 
36  size_t operator()(MoreTypes layer) const;
37 
38  private:
40  template<typename T>
41  typename std::enable_if<
42  !HasInputShapeCheck<T>::value, size_t>::type
43  LayerInputShape(T* layer) const;
44 
46  template<typename T>
47  typename std::enable_if<
48  HasInputShapeCheck<T>::value, size_t>::type
49  LayerInputShape(T* layer) const;
50 };
51 
52 } // namespace ann
53 } // namespace mlpack
54 
55 // Include implementation.
57 
58 #endif
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
InShapeVisitor returns the input shape a Layer expects.
Definition: input_shape_visitor.hpp:29
size_t operator()(LayerType *layer) const
Return the input shape of layer.