27 #ifndef LBANN_LAYERS_ACTIVATIONS_LEAKY_RELU_IMPL_HPP_INCLUDED 28 #define LBANN_LAYERS_ACTIVATIONS_LEAKY_RELU_IMPL_HPP_INCLUDED 32 #ifdef LBANN_HAS_DISTCONV 34 #endif // LBANN_HAS_DISTCONV 38 template <
typename T, data_layout L, El::Device D>
40 lbann_data::Layer& proto)
const 42 proto.set_datatype(proto::ProtoDataType<T>);
43 auto* msg = proto.mutable_leaky_relu();
44 msg->set_negative_slope(m_negative_slope);
47 #ifdef LBANN_HAS_DISTCONV 48 template <
typename TensorDataType, data_layout T_layout, El::Device Dev>
49 leaky_relu_distconv_adapter<TensorDataType, T_layout, Dev>&
53 leaky_relu_distconv_adapter<TensorDataType, T_layout, Dev>&
>(
55 .get_distconv_adapter());
58 template <
typename TensorDataType, data_layout T_layout, El::Device Dev>
59 const leaky_relu_distconv_adapter<TensorDataType, T_layout, Dev>&
63 const leaky_relu_distconv_adapter<TensorDataType, T_layout, Dev>&
>(
67 template <
typename TensorDataType, data_layout T_layout, El::Device Dev>
68 void leaky_relu_distconv_adapter<TensorDataType, T_layout, Dev>::
73 auto& x = this->get_prev_activations_dist();
74 auto& y = this->get_activations_dist();
75 auto& dx = this->get_error_signals_dist();
76 auto& dy = this->get_prev_error_signals_dist();
86 template <
typename TensorDataType, data_layout T_layout, El::Device Dev>
87 void leaky_relu_distconv_adapter<TensorDataType, T_layout, Dev>::setup_layer(
88 size_t workspace_capacity)
90 m_leaky_relu = std::make_unique<dc::LeakyReLU>(dc::get_backend());
92 #endif // LBANN_HAS_DISTCONV 96 #endif // LBANN_LAYERS_ACTIVATIONS_LEAKY_RELU_IMPL_HPP_INCLUDED
virtual void setup_distributions(tensor_overlap_constraints &constraints)
void mark_equivalent(dc::Dist &d1, dc::Dist &d2)
void write_specific_proto(lbann_data::Layer &proto) const final