27 #ifndef LBANN_LAYER_REDUCTION_HPP_INCLUDED 28 #define LBANN_LAYER_REDUCTION_HPP_INCLUDED 45 template <
typename TensorDataType,
62 template <
typename ArchiveT>
67 std::string
get_type()
const override {
return "reduction"; }
88 desc.add(
"Mode", mode_str);
94 void write_specific_proto(lbann_data::Layer& proto)
const final;
96 void setup_dims()
override;
98 void fp_compute()
override;
100 void bp_compute()
override;
103 #ifndef LBANN_REDUCTION_LAYER_INSTANTIATE 104 #define PROTO_DEVICE(T, Device) \ 105 extern template class reduction_layer<T, \ 106 data_layout::DATA_PARALLEL, \ 108 extern template class reduction_layer<T, data_layout::MODEL_PARALLEL, Device> 111 #endif // LBANN_REDUCTION_LAYER_INSTANTIATE 115 #endif // LBANN_LAYER_REDUCTION_HPP_INCLUDED
bool can_run_inplace() const override
If True, the computation can run in-place (feeding each input activations tensor as the corresponding...
std::string get_type() const override
Get the layer type's name.
void serialize(std::ostream &os, google::protobuf::Message const &msg)
Serialize the protobuf message to a stream.
Generates nicely formatted description messages.
virtual description get_description() const
Human-readable description.
constexpr El::Device Device
El::Device get_device_allocation() const override
Get the device allocation for the data tensors. We assume that the decice allocation of the previous ...
data_layout get_data_layout() const override
Get data layout of the data tensors. We assume that the data layouts of the previous activations...
data_layout
Data layout that is optimized for different modes of parallelism.
reduction_layer * copy() const override
Copy function. This function dynamically allocates memory for a layer instance and instantiates a cop...
description get_description() const override
Human-readable description.
int get_backprop_requirements() const override
Returns the necessary tensors for computing backpropagation.