27 #ifndef LBANN_LAYER_CATEGORICAL_RANDOM_HPP_INCLUDED 28 #define LBANN_LAYER_CATEGORICAL_RANDOM_HPP_INCLUDED 44 template <
typename TensorDataType,
49 static_assert(Dev == El::Device::CPU,
50 "categorical random layer currently only supports CPU");
52 "categorical random layer currently only " 53 "supports DATA_PARALLEL");
67 template <
typename ArchiveT>
72 std::string
get_type()
const override {
return "categorical random"; }
88 #ifndef LBANN_CATEGORICAL_RANDOM_LAYER_INSTANTIATE 91 extern template class categorical_random_layer<T, \ 92 data_layout::DATA_PARALLEL, \ 95 #define LBANN_INSTANTIATE_CPU_HALF 98 #undef LBANN_INSTANTIATE_CPU_HALF 100 #endif // LBANN_CATEGORICAL_RANDOM_LAYER_INSTANTIATE 104 #endif // LBANN_LAYER_CATEGORICAL_RANDOM_HPP_INCLUDED categorical_random_layer(lbann_comm *comm)
categorical_random_layer()
friend class cereal::access
categorical_random_layer * copy() const override
Copy function. This function dynamically allocates memory for a layer instance and instantiates a cop...
Random categorical outputs.
void write_specific_proto(lbann_data::Layer &proto) const final
void serialize(ArchiveT &ar)
constexpr El::Device Device
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.
int get_backprop_requirements() const override
Returns the necessary tensors for computing backpropagation.
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.
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.
bool can_run_inplace() const override
If True, the computation can run in-place (feeding each input activations tensor as the corresponding...