27 #ifndef STOP_GRADIENT_HPP_INCLUDED 28 #define STOP_GRADIENT_HPP_INCLUDED 42 template <
typename TensorDataType, data_layout T_layout, El::Device Dev>
56 template <
typename ArchiveT>
61 std::string
get_type()
const override {
return "stop_gradient"; }
86 #ifndef LBANN_STOP_GRADIENT_LAYER_INSTANTIATE 87 #define PROTO_DEVICE(T, Device) \ 88 extern template class stop_gradient_layer<T, \ 89 data_layout::DATA_PARALLEL, \ 91 extern template class stop_gradient_layer<T, \ 92 data_layout::MODEL_PARALLEL, \ 97 #endif // LBANN_STOP_GRADIENT_LAYER_INSTANTIATE 101 #endif // STOP_GRADIENT_HPP_INCLUDED virtual void setup_dims()
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.
data_layout get_data_layout() const override
Get data layout of the data tensors. We assume that the data layouts of the previous activations...
stop_gradient_layer(lbann_comm *comm)
El::Device get_device_allocation() const override
Get the device allocation for the data tensors. We assume that the decice allocation of the previous ...
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.
void fp_setup_outputs() override
Setup output tensors. Called by the 'forward_prop' function. Each output tensor is resized to match t...
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.
std::vector< int > get_input_dims(size_t input_index=0) const
Get input tensor dimensions.
void serialize(ArchiveT &ar)
constexpr El::Device Device
void write_specific_proto(lbann_data::Layer &proto) const final
InputAbsDistMatrixType & get_prev_activations(int parent_index=0)
const OutputAbsDistMatrixType & get_activations(const Layer &child) const override
stop_gradient_layer * copy() const override
Copy function. This function dynamically allocates memory for a layer instance and instantiates a cop...
void set_output_dims(std::vector< int > dims, size_t output_index=0)
Set output tensor dimensions.
Block error signals during back propagation.
friend class cereal::access
std::string get_type() const override
Get the layer type's name.
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.
bool can_run_inplace() const override
If True, the computation can run in-place (feeding each input activations tensor as the corresponding...