C++ API Reference for Intel® Data Analytics Acceleration Library 2019 Update 5

reshape_layer.h
1 /* file: reshape_layer.h */
2 /*******************************************************************************
3 * Copyright 2014-2019 Intel Corporation.
4 *
5 * This software and the related documents are Intel copyrighted materials, and
6 * your use of them is governed by the express license under which they were
7 * provided to you (License). Unless the License provides otherwise, you may not
8 * use, modify, copy, publish, distribute, disclose or transmit this software or
9 * the related documents without Intel's prior written permission.
10 *
11 * This software and the related documents are provided as is, with no express
12 * or implied warranties, other than those that are expressly stated in the
13 * License.
14 *******************************************************************************/
15 
16 /*
17 //++
18 // Implementation of the reshape layer interface
19 //--
20 */
21 
22 #ifndef __RESHAPE_LAYER_H__
23 #define __RESHAPE_LAYER_H__
24 
25 #include "algorithms/algorithm.h"
26 #include "data_management/data/tensor.h"
27 #include "services/daal_defines.h"
28 #include "algorithms/neural_networks/layers/layer.h"
29 #include "algorithms/neural_networks/layers/reshape/reshape_layer_types.h"
30 #include "algorithms/neural_networks/layers/reshape/reshape_layer_forward.h"
31 #include "algorithms/neural_networks/layers/reshape/reshape_layer_backward.h"
32 
33 namespace daal
34 {
35 namespace algorithms
36 {
37 namespace neural_networks
38 {
39 namespace layers
40 {
41 namespace reshape
42 {
46 namespace interface1
47 {
68 template<typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
69 class Batch : public LayerIface
70 {
71 public:
72  Parameter parameter;
74  Batch()
75  {
76  forward::Batch<algorithmFPType, method> *forwardLayerObject = new forward::Batch<algorithmFPType, method>(parameter);
77  backward::Batch<algorithmFPType, method> *backwardLayerObject = new backward::Batch<algorithmFPType, method>(parameter);
78 
79  LayerIface::forwardLayer = services::SharedPtr<forward::Batch<algorithmFPType, method> >(forwardLayerObject);
80  LayerIface::backwardLayer = services::SharedPtr<backward::Batch<algorithmFPType, method> >(backwardLayerObject);
81  };
82 
88  Batch(const services::Collection<size_t> &dims)
89  {
90  parameter.reshapeDimensions = dims;
91 
92  forward::Batch<algorithmFPType, method> *forwardLayerObject = new forward::Batch<algorithmFPType, method>(parameter);
93  backward::Batch<algorithmFPType, method> *backwardLayerObject = new backward::Batch<algorithmFPType, method>(parameter);
94 
95  LayerIface::forwardLayer = services::SharedPtr<forward::Batch<algorithmFPType, method> >(forwardLayerObject);
96  LayerIface::backwardLayer = services::SharedPtr<backward::Batch<algorithmFPType, method> >(backwardLayerObject);
97  };
98 };
100 } // namespace interface1
101 using interface1::Batch;
102 
103 } // namespace reshape
104 } // namespace layers
105 } // namespace neural_networks
106 } // namespace algorithms
107 } // namespace daal
108 #endif
daal::algorithms::neural_networks::layers::reshape::interface1::Batch
Provides methods for the reshape layer in the batch processing mode.
Definition: reshape_layer.h:69
daal
Definition: algorithm_base_common.h:31
daal_defines.h
daal::algorithms::neural_networks::layers::reshape::interface1::Parameter
Parameters for the reshape layer.
Definition: reshape_layer_types.h:87
daal::algorithms::neural_networks::layers::reshape::interface1::Batch::parameter
Parameter parameter
Definition: reshape_layer.h:72
daal::algorithms::neural_networks::layers::reshape::interface1::Batch::Batch
Batch()
Definition: reshape_layer.h:74
daal::algorithms::neural_networks::layers::reshape::interface1::Batch::Batch
Batch(const services::Collection< size_t > &dims)
Definition: reshape_layer.h:88

For more complete information about compiler optimizations, see our Optimization Notice.