1 // Copyright 2016, Tobias Hermann.
2 // https://github.com/Dobiasd/frugally-deep
3 // Distributed under the MIT License.
4 // (See accompanying LICENSE file or at
5 //  https://opensource.org/licenses/MIT)
6 
7 #pragma once
8 
9 #include "fdeep/layers/activation_layer.hpp"
10 #include "fdeep/recurrent_ops.hpp"
11 
12 #include <limits>
13 #include <string>
14 
15 namespace fdeep { namespace internal
16 {
17 
18 class gelu_layer : public activation_layer
19 {
20 public:
gelu_layer(const std::string & name)21     explicit gelu_layer(const std::string& name)
22         : activation_layer(name)
23     {
24     }
25 protected:
transform_input(const tensor & in_vol) const26     tensor transform_input(const tensor& in_vol) const override
27     {
28         return transform_tensor(gelu_activation, in_vol);
29     }
30 };
31 
32 } } // namespace fdeep, namespace internal
33