23 #ifndef __RESHAPE_LAYER_FORWARD_H__
24 #define __RESHAPE_LAYER_FORWARD_H__
26 #include "algorithms/algorithm.h"
27 #include "data_management/data/tensor.h"
28 #include "services/daal_defines.h"
29 #include "algorithms/neural_networks/layers/layer.h"
30 #include "algorithms/neural_networks/layers/reshape/reshape_layer_types.h"
31 #include "algorithms/neural_networks/layers/reshape/reshape_layer_forward_types.h"
37 namespace neural_networks
62 template<
typename algorithmFPType, Method method, CpuType cpu>
63 class DAAL_EXPORT BatchContainer :
public layers::forward::LayerContainerIfaceImpl
70 BatchContainer(daal::services::Environment::env *daalEnv);
78 services::Status compute() DAAL_C11_OVERRIDE;
98 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
99 class Batch :
public layers::forward::LayerIfaceImpl
102 typedef layers::forward::LayerIfaceImpl super;
104 typedef algorithms::neural_networks::layers::reshape::forward::Input InputType;
105 typedef algorithms::neural_networks::layers::reshape::Parameter ParameterType;
106 typedef algorithms::neural_networks::layers::reshape::forward::Result ResultType;
108 ParameterType ¶meter;
112 Batch() : parameter(_defaultParameter)
122 Batch(
const services::Collection<size_t> &dims) : parameter(_defaultParameter)
124 parameter.reshapeDimensions = dims;
133 Batch(ParameterType& parameter) : parameter(parameter), _defaultParameter(parameter)
144 Batch(
const Batch<algorithmFPType, method> &other) : super(other),
145 _defaultParameter(other.parameter), parameter(_defaultParameter), input(other.input)
154 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int) method; }
160 virtual InputType *getLayerInput() DAAL_C11_OVERRIDE {
return &input; }
166 virtual ParameterType *getLayerParameter() DAAL_C11_OVERRIDE {
return ¶meter; };
172 layers::forward::ResultPtr getLayerResult() DAAL_C11_OVERRIDE
181 ResultPtr getResult()
192 services::Status setResult(
const ResultPtr& result)
194 DAAL_CHECK(result, services::ErrorNullResult)
196 _res = _result.get();
197 return services::Status();
206 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
208 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
216 virtual services::Status allocateResult() DAAL_C11_OVERRIDE
218 services::Status s = this->_result->template allocate<algorithmFPType>(&(this->input), ¶meter, (
int) method);
219 this->_res = this->_result.get();
224 virtual Batch<algorithmFPType, method> *cloneImpl() const DAAL_C11_OVERRIDE
226 return new Batch<algorithmFPType, method>(*this);
231 Analysis<batch>::_ac =
new __DAAL_ALGORITHM_LAYER_CONTAINER(BatchContainer, algorithmFPType, method)(&_env);
234 _result.reset(
new ResultType());
239 ParameterType _defaultParameter;
243 using interface1::BatchContainer;
244 using interface1::Batch;
daal::algorithms::neural_networks::layers::reshape::forward::interface1::Batch::getLayerInput
virtual InputType * getLayerInput() DAAL_C11_OVERRIDE
Definition: reshape_layer_forward.h:160
daal::algorithms::neural_networks::layers::reshape::forward::interface1::Batch::setResult
services::Status setResult(const ResultPtr &result)
Definition: reshape_layer_forward.h:192
daal
Definition: algorithm_base_common.h:31
daal::algorithms::neural_networks::layers::reshape::forward::interface1::Batch::Batch
Batch(ParameterType ¶meter)
Definition: reshape_layer_forward.h:133
daal::algorithms::neural_networks::layers::reshape::forward::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: reshape_layer_forward.h:154
daal::algorithms::neural_networks::layers::reshape::forward::interface1::Batch::allocateResult
virtual services::Status allocateResult() DAAL_C11_OVERRIDE
Definition: reshape_layer_forward.h:216
daal::algorithms::neural_networks::layers::reshape::forward::interface1::BatchContainer
Provides methods to run implementations of the of the forward reshape layer This class is associated ...
Definition: reshape_layer_forward.h:63
daal::algorithms::neural_networks::layers::reshape::forward::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: reshape_layer_forward.h:206
daal::algorithms::neural_networks::layers::reshape::forward::interface1::Batch::Batch
Batch(const services::Collection< size_t > &dims)
Definition: reshape_layer_forward.h:122
daal::algorithms::neural_networks::layers::reshape::forward::interface1::Batch::getLayerParameter
virtual ParameterType * getLayerParameter() DAAL_C11_OVERRIDE
Definition: reshape_layer_forward.h:166
daal::algorithms::neural_networks::layers::reshape::forward::interface1::Batch::getResult
ResultPtr getResult()
Definition: reshape_layer_forward.h:181
daal::algorithms::neural_networks::layers::reshape::forward::interface1::Batch::input
InputType input
Definition: reshape_layer_forward.h:109
daal::algorithms::neural_networks::layers::reshape::forward::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: reshape_layer_forward.h:144
daal::algorithms::neural_networks::layers::reshape::forward::interface1::Batch::getLayerResult
layers::forward::ResultPtr getLayerResult() DAAL_C11_OVERRIDE
Definition: reshape_layer_forward.h:172
daal::algorithms::Analysis
Provides methods for execution of operations over data, such as computation of Summary Statistics est...
Definition: analysis.h:68
daal::algorithms::neural_networks::layers::reshape::forward::interface1::Batch
Computes the result of the forward reshape layer in the batch processing mode.
Definition: reshape_layer_forward.h:99
daal::algorithms::neural_networks::layers::reshape::forward::interface1::Batch::parameter
ParameterType & parameter
Definition: reshape_layer_forward.h:108
daal::algorithms::neural_networks::layers::reshape::forward::interface1::Batch::Batch
Batch()
Definition: reshape_layer_forward.h:112
daal::services::ErrorNullResult
Definition: error_indexes.h:96