ONE - On-device Neural Engine
Loading...
Searching...
No Matches
onert::backend::train::ops::BackPropInitializer Class Reference

#include <BackPropInitializer.h>

Collaboration diagram for onert::backend::train::ops::BackPropInitializer:

Public Member Functions

 BackPropInitializer (const std::vector< BackPropTensor * > back_props)
 
void forward (bool training) override
 
void backward () override
 
- Public Member Functions inherited from onert::exec::train::ITrainableFunction
virtual ~ITrainableFunction ()=default
 
virtual std::optional< backend::train::LayerScopeTensorsregisterLayerScopeTensors ()
 

Detailed Description

Definition at line 35 of file BackPropInitializer.h.

Constructor & Destructor Documentation

◆ BackPropInitializer()

onert::backend::train::ops::BackPropInitializer::BackPropInitializer ( const std::vector< BackPropTensor * >  back_props)

Definition at line 28 of file BackPropInitializer.cc.

29 : _back_props{back_props}
30{
31 assert(std::all_of(back_props.cbegin(), back_props.cend(),
32 [](const BackPropTensor *back_prop) { return back_prop != nullptr; }));
33}
Tensor BackPropTensor
Definition Tensor.h:47

Member Function Documentation

◆ backward()

void onert::backend::train::ops::BackPropInitializer::backward ( )
overridevirtual

Implements onert::exec::train::ITrainableFunction.

Definition at line 40 of file BackPropInitializer.cc.

41{
42 for (auto &&back_prop_tensor : _back_props)
43 {
44 assert(back_prop_tensor->buffer() != nullptr);
45 memset(back_prop_tensor->buffer(), 0, back_prop_tensor->total_size());
46 }
47}

◆ forward()

void onert::backend::train::ops::BackPropInitializer::forward ( bool  training)
overridevirtual

Implements onert::exec::train::ITrainableFunction.

Definition at line 35 of file BackPropInitializer.cc.

36{
37 // DO NOTHING
38}

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