LBANN  0.103.0
LivermoreBigArtificialNeuralNetworkToolkit
lbann::ElementwiseOperator< InputT, OutputT, D > Class Template Referenceabstract

Element-wise specific tensor operation sub-class. More...

#include <elementwise_operator.hpp>

Inheritance diagram for lbann::ElementwiseOperator< InputT, OutputT, D >:
[legend]
Collaboration diagram for lbann::ElementwiseOperator< InputT, OutputT, D >:
[legend]

Public Types

Public Types
using BaseType = Cloneable< HasAbstractFunction< ElementwiseOperator< InputT, OutputT, D > >, Operator< InputT, OutputT, D > >
 
using InputTensorType = typename BaseType::InputTensorType
 
using OutputTensorType = typename BaseType::OutputTensorType
 
using ConstInputTensorType = typename BaseType::ConstInputTensorType
 
using ConstOutputTensorType = typename BaseType::ConstOutputTensorType
 
using LocalInputTensorType = utils::TensorView< InputT, D >
 
using LocalOutputTensorType = utils::TensorView< OutputT, D >
 
using ConstLocalInputTensorType = utils::ConstTensorView< InputT, D >
 
using ConstLocalOutputTensorType = utils::ConstTensorView< OutputT, D >
 

Public Member Functions

 ElementwiseOperator ()=default
 
virtual ~ElementwiseOperator ()=default
 
Serialization
template<typename ArchiveT >
void serialize (ArchiveT &ar)
 
- Public Member Functions inherited from lbann::Cloneable< T, Base >
std::unique_ptr< T > clone () const
 Return an exception-safe, memory-safe copy of this object. More...
 

Protected Member Functions

Lifecycle management.
 ElementwiseOperator (ElementwiseOperator const &)=default
 
ElementwiseOperatoroperator= (ElementwiseOperator const &)=default
 
 ElementwiseOperator (ElementwiseOperator &&)=default
 
ElementwiseOperatoroperator= (ElementwiseOperator &&)=default
 
Local compute interface
virtual void fp_compute_local (std::vector< ConstLocalInputTensorType > input, std::vector< LocalOutputTensorType > output) const =0
 Local forward compute function. More...
 
virtual void bp_compute_local (std::vector< ConstLocalInputTensorType > input, std::vector< ConstLocalOutputTensorType > gradient_wrt_output, std::vector< LocalInputTensorType > gradient_wrt_input) const =0
 Local backward compute function. More...
 

Virtual compute interface

void fp_compute (std::vector< ConstInputTensorType > const &inputs, std::vector< OutputTensorType > const &outputs) const final
 Apply operator's forward operation. More...
 
void bp_compute (std::vector< ConstInputTensorType > const &inputs, std::vector< ConstOutputTensorType > const &gradient_wrt_outputs, std::vector< InputTensorType > const &gradient_wrt_inputs) const final
 Compute operator's "backward" operation. More...
 
template<typename TensorViewType >
static auto get_local_tensor_views (std::vector< TensorViewType > const &in)
 

Detailed Description

template<typename InputT, typename OutputT, El::Device D>
class lbann::ElementwiseOperator< InputT, OutputT, D >

Element-wise specific tensor operation sub-class.

This layer manages some of the

Definition at line 45 of file elementwise_operator.hpp.

Member Typedef Documentation

◆ BaseType

template<typename InputT, typename OutputT, El::Device D>
using lbann::ElementwiseOperator< InputT, OutputT, D >::BaseType = Cloneable<HasAbstractFunction<ElementwiseOperator<InputT, OutputT, D> >, Operator<InputT, OutputT, D> >

Definition at line 55 of file elementwise_operator.hpp.

◆ ConstInputTensorType

template<typename InputT, typename OutputT, El::Device D>
using lbann::ElementwiseOperator< InputT, OutputT, D >::ConstInputTensorType = typename BaseType::ConstInputTensorType

Definition at line 59 of file elementwise_operator.hpp.

◆ ConstLocalInputTensorType

template<typename InputT, typename OutputT, El::Device D>
using lbann::ElementwiseOperator< InputT, OutputT, D >::ConstLocalInputTensorType = utils::ConstTensorView<InputT, D>

Definition at line 64 of file elementwise_operator.hpp.

◆ ConstLocalOutputTensorType

template<typename InputT, typename OutputT, El::Device D>
using lbann::ElementwiseOperator< InputT, OutputT, D >::ConstLocalOutputTensorType = utils::ConstTensorView<OutputT, D>

Definition at line 65 of file elementwise_operator.hpp.

◆ ConstOutputTensorType

template<typename InputT, typename OutputT, El::Device D>
using lbann::ElementwiseOperator< InputT, OutputT, D >::ConstOutputTensorType = typename BaseType::ConstOutputTensorType

Definition at line 60 of file elementwise_operator.hpp.

◆ InputTensorType

template<typename InputT, typename OutputT, El::Device D>
using lbann::ElementwiseOperator< InputT, OutputT, D >::InputTensorType = typename BaseType::InputTensorType

Definition at line 57 of file elementwise_operator.hpp.

◆ LocalInputTensorType

template<typename InputT, typename OutputT, El::Device D>
using lbann::ElementwiseOperator< InputT, OutputT, D >::LocalInputTensorType = utils::TensorView<InputT, D>

Definition at line 62 of file elementwise_operator.hpp.

◆ LocalOutputTensorType

template<typename InputT, typename OutputT, El::Device D>
using lbann::ElementwiseOperator< InputT, OutputT, D >::LocalOutputTensorType = utils::TensorView<OutputT, D>

Definition at line 63 of file elementwise_operator.hpp.

◆ OutputTensorType

template<typename InputT, typename OutputT, El::Device D>
using lbann::ElementwiseOperator< InputT, OutputT, D >::OutputTensorType = typename BaseType::OutputTensorType

Definition at line 58 of file elementwise_operator.hpp.

Constructor & Destructor Documentation

◆ ElementwiseOperator() [1/3]

template<typename InputT, typename OutputT, El::Device D>
lbann::ElementwiseOperator< InputT, OutputT, D >::ElementwiseOperator ( )
default
Here is the caller graph for this function:

◆ ~ElementwiseOperator()

template<typename InputT, typename OutputT, El::Device D>
virtual lbann::ElementwiseOperator< InputT, OutputT, D >::~ElementwiseOperator ( )
virtualdefault

◆ ElementwiseOperator() [2/3]

template<typename InputT, typename OutputT, El::Device D>
lbann::ElementwiseOperator< InputT, OutputT, D >::ElementwiseOperator ( ElementwiseOperator< InputT, OutputT, D > const &  )
protecteddefault

◆ ElementwiseOperator() [3/3]

template<typename InputT, typename OutputT, El::Device D>
lbann::ElementwiseOperator< InputT, OutputT, D >::ElementwiseOperator ( ElementwiseOperator< InputT, OutputT, D > &&  )
protecteddefault

Member Function Documentation

◆ bp_compute()

template<typename InputT, typename OutputT, El::Device D>
void lbann::ElementwiseOperator< InputT, OutputT, D >::bp_compute ( std::vector< ConstInputTensorType > const &  inputs,
std::vector< ConstOutputTensorType > const &  gradient_wrt_outputs,
std::vector< InputTensorType > const &  gradient_wrt_inputs 
) const
inlinefinal

Compute operator's "backward" operation.

Given the inputs, outputs, and gradient w.r.t. output tensors, the gradient w.r.t. input tensors are populated with the computed values.

Definition at line 123 of file elementwise_operator.hpp.

Here is the call graph for this function:

◆ bp_compute_local()

template<typename InputT, typename OutputT, El::Device D>
virtual void lbann::ElementwiseOperator< InputT, OutputT, D >::bp_compute_local ( std::vector< ConstLocalInputTensorType input,
std::vector< ConstLocalOutputTensorType gradient_wrt_output,
std::vector< LocalInputTensorType gradient_wrt_input 
) const
protectedpure virtual

Local backward compute function.

Here is the caller graph for this function:

◆ fp_compute()

template<typename InputT, typename OutputT, El::Device D>
void lbann::ElementwiseOperator< InputT, OutputT, D >::fp_compute ( std::vector< ConstInputTensorType > const &  inputs,
std::vector< OutputTensorType > const &  outputs 
) const
inlinefinal

Apply operator's forward operation.

Given the input tensors, the output tensors are populated with computed values.

Definition at line 107 of file elementwise_operator.hpp.

Here is the call graph for this function:

◆ fp_compute_local()

template<typename InputT, typename OutputT, El::Device D>
virtual void lbann::ElementwiseOperator< InputT, OutputT, D >::fp_compute_local ( std::vector< ConstLocalInputTensorType input,
std::vector< LocalOutputTensorType output 
) const
protectedpure virtual

Local forward compute function.

Here is the caller graph for this function:

◆ get_local_tensor_views()

template<typename InputT, typename OutputT, El::Device D>
template<typename TensorViewType >
static auto lbann::ElementwiseOperator< InputT, OutputT, D >::get_local_tensor_views ( std::vector< TensorViewType > const &  in)
inlinestatic

Definition at line 90 of file elementwise_operator.hpp.

Here is the caller graph for this function:

◆ operator=() [1/2]

template<typename InputT, typename OutputT, El::Device D>
ElementwiseOperator& lbann::ElementwiseOperator< InputT, OutputT, D >::operator= ( ElementwiseOperator< InputT, OutputT, D > const &  )
protecteddefault
Here is the caller graph for this function:

◆ operator=() [2/2]

template<typename InputT, typename OutputT, El::Device D>
ElementwiseOperator& lbann::ElementwiseOperator< InputT, OutputT, D >::operator= ( ElementwiseOperator< InputT, OutputT, D > &&  )
protecteddefault

◆ serialize()

template<typename InputT, typename OutputT, El::Device D>
template<typename ArchiveT >
void lbann::ElementwiseOperator< InputT, OutputT, D >::serialize ( ArchiveT &  ar)
inline

Definition at line 77 of file elementwise_operator.hpp.


The documentation for this class was generated from the following file: