delete_visitor.hpp
Go to the documentation of this file.
1 
13 #ifndef MLPACK_METHODS_ANN_VISITOR_DELETE_VISITOR_HPP
14 #define MLPACK_METHODS_ANN_VISITOR_DELETE_VISITOR_HPP
15 
18 
19 #include <boost/variant.hpp>
20 
21 namespace mlpack {
22 namespace ann {
23 
27 class DeleteVisitor : public boost::static_visitor<void>
28 {
29  public:
31  template<typename LayerType>
32  typename std::enable_if<
33  !HasModelCheck<LayerType>::value, void>::type
34  operator()(LayerType* layer) const;
35 
37  template<typename LayerType>
38  typename std::enable_if<
39  HasModelCheck<LayerType>::value, void>::type
40  operator()(LayerType* layer) const;
41 
42  void operator()(MoreTypes layer) const;
43 };
44 
45 } // namespace ann
46 } // namespace mlpack
47 
48 // Include implementation.
49 #include "delete_visitor_impl.hpp"
50 
51 #endif
DeleteVisitor executes the destructor of the instantiated object.
Linear algebra utility functions, generally performed on matrices or vectors.
std::enable_if< !HasModelCheck< LayerType >::value, void >::type operator()(LayerType *layer) const
Execute the destructor if the layer does not hold layers internally.
boost::variant< FlexibleReLU< arma::mat, arma::mat > *, Linear3D< arma::mat, arma::mat, NoRegularizer > *, LpPooling< arma::mat, arma::mat > *, PixelShuffle< arma::mat, arma::mat > *, ChannelShuffle< arma::mat, arma::mat > *, Glimpse< arma::mat, arma::mat > *, Highway< arma::mat, arma::mat > *, MultiheadAttention< arma::mat, arma::mat, NoRegularizer > *, Recurrent< arma::mat, arma::mat > *, RecurrentAttention< arma::mat, arma::mat > *, ReinforceNormal< arma::mat, arma::mat > *, ReLU6< arma::mat, arma::mat > *, Reparametrization< arma::mat, arma::mat > *, Select< arma::mat, arma::mat > *, SpatialDropout< arma::mat, arma::mat > *, Subview< arma::mat, arma::mat > *, VRClassReward< arma::mat, arma::mat > *, VirtualBatchNorm< arma::mat, arma::mat > *, RBF< arma::mat, arma::mat, GaussianFunction > *, BaseLayer< GaussianFunction, arma::mat, arma::mat > *, PositionalEncoding< arma::mat, arma::mat > *, ISRLU< arma::mat, arma::mat > *, BicubicInterpolation< arma::mat, arma::mat > *, NearestInterpolation< arma::mat, arma::mat > *, GroupNorm< arma::mat, arma::mat > *> MoreTypes