27 #ifndef LBANN_LAYER_CONSTANT_HPP_INCLUDED 28 #define LBANN_LAYER_CONSTANT_HPP_INCLUDED 35 template <
typename TensorDataType,
53 template <
typename ArchiveT>
58 std::string
get_type()
const override {
return "constant"; }
93 #ifndef LBANN_CONSTANT_LAYER_INSTANTIATE 94 #define PROTO_DEVICE(T, Device) \ 95 extern template class constant_layer<T, data_layout::DATA_PARALLEL, Device>; \ 96 extern template class constant_layer<T, data_layout::MODEL_PARALLEL, Device> 100 #endif // LBANN_CONSTANT_LAYER_INSTANTIATE 104 #endif // LBANN_LAYER_CONSTANT_HPP_INCLUDED void serialize(ArchiveT &ar)
constant_layer(lbann_comm *comm, TensorDataType value, std::vector< int > dims)
constant_layer * copy() const override
Copy function. This function dynamically allocates memory for a layer instance and instantiates a cop...
Generates nicely formatted description messages.
virtual description get_description() const
Human-readable description.
void write_specific_proto(lbann_data::Layer &proto) const final
constexpr El::Device Device
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.
description get_description() const override
Human-readable description.
const OutputAbsDistMatrixType & get_activations(const Layer &child) const override
data_layout get_data_layout() const override
Get data layout of the data tensors. We assume that the data layouts of the previous activations...
void set_output_dims(std::vector< int > dims, size_t output_index=0)
Set output tensor dimensions.
friend class cereal::access
El::Device get_device_allocation() const override
Get the device allocation for the data tensors. We assume that the decice allocation of the previous ...
Output tensor filled with a single value.
bool can_run_inplace() const override
If True, the computation can run in-place (feeding each input activations tensor as the corresponding...
data_layout
Data layout that is optimized for different modes of parallelism.
std::string get_type() const override
Get the layer type's name.
int get_backprop_requirements() const override
Returns the necessary tensors for computing backpropagation.
int m_expected_num_parent_layers