27 #ifndef LBANN_LAYERS_TRANSFORM_BATCHWISE_REDUCE_SUM_HPP_INCLUDED 28 #define LBANN_LAYERS_TRANSFORM_BATCHWISE_REDUCE_SUM_HPP_INCLUDED 38 template <
typename TensorDataType,
54 template <
typename ArchiveT>
59 std::string
get_type()
const override;
75 #ifndef LBANN_BATCHWISE_REDUCE_SUM_LAYER_INSTANTIATE 76 #define PROTO_DEVICE(T, Device) \ 77 extern template class batchwise_reduce_sum_layer<T, \ 78 data_layout::DATA_PARALLEL, \ 80 extern template class batchwise_reduce_sum_layer< \ 82 data_layout::MODEL_PARALLEL, \ 86 #endif // LBANN_BATCHWISE_REDUCE_SUM_LAYER_INSTANTIATE 90 #endif // LBANN_LAYERS_TRANSFORM_BATCHWISE_REDUCE_SUM_HPP_INCLUDED void write_specific_proto(lbann_data::Layer &proto) const final
batchwise_reduce_sum_layer * copy() const override
Copy function. This function dynamically allocates memory for a layer instance and instantiates a cop...
data_layout get_data_layout() const override
Get data layout of the data tensors. We assume that the data layouts of the previous activations...
constexpr El::Device Device
void serialize(ArchiveT &ar)
batchwise_reduce_sum_layer()
void fp_compute() override
Apply layer operation. Called by the 'forward_prop' function. Given the input tensors, the output tensors are populated with computed values.
int get_backprop_requirements() const override
Returns the necessary tensors for computing backpropagation.
std::string get_type() const override
Get the layer type's name.
data_layout
Data layout that is optimized for different modes of parallelism.
El::Device get_device_allocation() const override
Get the device allocation for the data tensors. We assume that the decice allocation of the previous ...
Sum of tensor entries along batch dimension.
bool can_run_inplace() const override
If True, the computation can run in-place (feeding each input activations tensor as the corresponding...
void bp_compute() override
Compute objective funciton gradients. Called by the 'back_prop' function. Given the input...
batchwise_reduce_sum_layer & operator=(const batchwise_reduce_sum_layer &other)=default
void setup_dims() override
Setup tensor dimensions Called by the 'setup' function. If there are any input tensors, the base method sets all uninitialized output tensor dimensions equal to the first input tensor dimensions.