26 #ifndef LBANN_LAYERS_OPERATOR_LAYER_HPP_INCLUDED 27 #define LBANN_LAYERS_OPERATOR_LAYER_HPP_INCLUDED 36 #include <cereal/access.hpp> 46 template <
typename InputT,
typename OutputT, data_layout Layout, El::Device D>
91 template <typename ArchiveT>
105 static std::vector<
size_t>
fix_type(std::vector<
int> const& in);
107 std::vector<utils::ConstDistTensorView<InputT, D>>
get_inputs() const;
108 std::vector<utils::DistTensorView<OutputT, D>>
get_outputs();
109 std::vector<utils::ConstDistTensorView<OutputT, D>>
115 template <typename InputT,
123 #endif // LBANN_LAYERS_OPERATOR_LAYER_HPP_INCLUDED
std::string get_type() const final
Get the layer type's name.
std::vector< utils::ConstDistTensorView< OutputT, D > > get_grad_wrt_outputs() const
std::vector< OperatorPtr > m_ops
static std::vector< size_t > fix_type(std::vector< int > const &in)
void write_specific_proto(lbann_data::Layer &proto) const final
El::Device get_device_allocation() const final
Get the device allocation for the data tensors. We assume that the decice allocation of the previous ...
OperatorLayer & operator=(OperatorLayer const &other)
Copy assignment.
description get_description() const final
Human-readable description.
Neural network tensor operation.
Generates nicely formatted description messages.
constexpr El::Device Device
std::unique_ptr< Layer > build_operator_layer_from_pbuf(lbann_comm *, lbann_data::Layer const &)
~OperatorLayer()=default
Destructor.
std::vector< utils::ConstDistTensorView< InputT, D > > get_inputs() const
void serialize(ArchiveT &)
void bp_compute() final
Compute objective funciton gradients. Called by the 'back_prop' function. Given the input...
static std::vector< OperatorPtr > clone_ops(std::vector< OperatorPtr > const &ops)
OperatorLayer * copy() const final
Polymorphic copy.
int get_backprop_requirements() const final
Returns the necessary tensors for computing backpropagation.
data_layout
Data layout that is optimized for different modes of parallelism.
void fp_compute() final
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 final
Get data layout of the data tensors. We assume that the data layouts of the previous activations...
Neural network tensor operation.
std::vector< utils::DistTensorView< OutputT, D > > get_outputs()
bool can_run_inplace() const final
If True, the computation can run in-place (feeding each input activations tensor as the corresponding...
std::unique_ptr< OperatorType > OperatorPtr
Layer composed of one or more operator objects.
std::vector< utils::DistTensorView< InputT, D > > get_grad_wrt_inputs()