27 #ifndef LBANN_LAYER_WEIGHTS_HPP_INCLUDED 28 #define LBANN_LAYER_WEIGHTS_HPP_INCLUDED 38 template <
typename TensorDataType,
49 using MatType = El::Matrix<TensorDataType, Device>;
65 template <
typename ArchiveT>
70 std::string
get_type()
const override;
80 void setup_data(
size_t max_mini_batch_size)
override;
89 #ifndef LBANN_WEIGHTS_LAYER_INSTANTIATE 90 #define PROTO_DEVICE(T, Device) \ 91 extern template class weights_layer<T, data_layout::DATA_PARALLEL, Device>; \ 92 extern template class weights_layer<T, data_layout::MODEL_PARALLEL, Device> 95 #endif // LBANN_WEIGHTS_LAYER_INSTANTIATE 99 #endif // LBANN_LAYER_WEIGHTS_HPP_INCLUDED weights_layer(std::vector< El::Int > dims={})
weights_layer * copy() const override
Copy function. This function dynamically allocates memory for a layer instance and instantiates a cop...
bool can_run_inplace() const override
If True, the computation can run in-place (feeding each input activations tensor as the corresponding...
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 ...
std::string get_type() const override
Get the layer type's name.
void write_specific_proto(lbann_data::Layer &proto) const final
void bp_compute() override
Compute objective funciton gradients. Called by the 'back_prop' function. Given the input...
data_layout
Data layout that is optimized for different modes of parallelism.
El::Matrix< TensorDataType, Device > MatType
The concrete local matrix type used by this object.
weights_layer & operator=(const weights_layer &other)=default
void setup_data(size_t max_mini_batch_size) override
Setup layer data. Called by the 'setup' function. Memory is allocated for distributed matrices...
int get_backprop_requirements() const override
Returns the necessary tensors for computing backpropagation.
void serialize(ArchiveT &ar)
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.
data_layout get_data_layout() const override
Get data layout of the data tensors. We assume that the data layouts of the previous activations...