C++ API Reference for Intel® Data Analytics Acceleration Library 2020 Update 1

eltwise_sum_layer_forward_types.h
1 /* file: eltwise_sum_layer_forward_types.h */
2 /*******************************************************************************
3 * Copyright 2014-2020 Intel Corporation
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *******************************************************************************/
17 
18 /*
19 //++
20 // Implementation of forward element-wise sum layer.
21 //--
22 */
23 
24 #ifndef __ELTWISE_SUM_LAYER_FORWARD_TYPES_H__
25 #define __ELTWISE_SUM_LAYER_FORWARD_TYPES_H__
26 
27 #include "algorithms/algorithm.h"
28 #include "services/daal_defines.h"
29 
30 #include "data_management/data/tensor.h"
31 
32 #include "algorithms/neural_networks/layers/layer_forward_types.h"
33 #include "algorithms/neural_networks/layers/eltwise_sum/eltwise_sum_layer_types.h"
34 
35 namespace daal
36 {
37 namespace algorithms
38 {
39 namespace neural_networks
40 {
41 namespace layers
42 {
43 namespace eltwise_sum
44 {
54 namespace forward
55 {
56 
61 enum InputId
62 {
63  coefficients = layers::forward::lastInputLayerDataId + 1,
64  lastInputId = coefficients
65 };
66 
70 namespace interface1
71 {
72 
78 class DAAL_EXPORT Input : public layers::forward::Input
79 {
80 public:
81  typedef layers::forward::Input super;
86  Input();
87 
92  Input(const Input& other);
93 
94  /*
95  * \DAAL_DEPRECATED
96  */
97  virtual ~Input() {}
98 
102  using layers::forward::Input::set;
106  using layers::forward::Input::get;
107 
114  DAAL_DEPRECATED data_management::TensorPtr get(InputId id) const;
115 
122  DAAL_DEPRECATED void set(InputId id, const data_management::TensorPtr &value);
123 
131  DAAL_DEPRECATED data_management::TensorPtr get(layers::forward::InputLayerDataId id, size_t index) const;
132 
140  DAAL_DEPRECATED void set(layers::forward::InputLayerDataId id, const data_management::TensorPtr &value, size_t index);
141 
150  DAAL_DEPRECATED_VIRTUAL virtual services::Status addData(const data_management::TensorPtr &dataTensor, size_t index) DAAL_C11_OVERRIDE;
151 
158  DAAL_DEPRECATED_VIRTUAL virtual services::Status eraseInputData() DAAL_C11_OVERRIDE;
159 
168  DAAL_DEPRECATED services::Status check(const daal::algorithms::Parameter *parameter, int method) const DAAL_C11_OVERRIDE;
169 
170 private:
175  DAAL_DEPRECATED services::Status checkInputTensors(const LayerData &layerData) const;
179  DAAL_DEPRECATED services::Status checkCoefficients(const LayerData &layerData) const;
180 
184  DAAL_DEPRECATED LayerDataPtr getInputLayerDataAllocateIfEmpty();
185 };
186 
193 class DAAL_EXPORT Result : public layers::forward::Result
194 {
195 public:
196  DECLARE_SERIALIZABLE_CAST(Result);
197 
202  Result();
203 
204  virtual ~Result() {}
205 
209  using layers::forward::Result::get;
210 
214  using layers::forward::Result::set;
215 
225  template <typename algorithmFPType>
226  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input,
227  const daal::algorithms::Parameter *parameter, const int method);
228 
234  DAAL_DEPRECATED_VIRTUAL virtual const services::Collection<size_t> getValueSize(const services::Collection<size_t> &inputSize,
235  const daal::algorithms::Parameter *par, const int method) const DAAL_C11_OVERRIDE;
236 
245  DAAL_DEPRECATED_VIRTUAL virtual services::Collection<size_t> getValueSize(const services::Collection< services::Collection<size_t> > &inputSize,
246  const daal::algorithms::Parameter *parameter, const int method) DAAL_C11_OVERRIDE;
247 
254  DAAL_DEPRECATED data_management::TensorPtr get(LayerDataId id) const;
255 
262  DAAL_DEPRECATED data_management::NumericTablePtr get(LayerDataNumericTableId id) const;
263 
270  DAAL_DEPRECATED void set(LayerDataId id, const data_management::TensorPtr &value);
271 
278  DAAL_DEPRECATED void set(LayerDataNumericTableId id, const data_management::NumericTablePtr &value);
279 
287  DAAL_DEPRECATED_VIRTUAL virtual services::Status setResultForBackward(const daal::algorithms::Input *input) DAAL_C11_OVERRIDE;
288 
298  DAAL_DEPRECATED_VIRTUAL virtual services::Status check(const daal::algorithms::Input *input,
299  const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
300 
301 protected:
306  template<typename Archive, bool onDeserialize>
307  services::Status serialImpl(Archive *arch)
308  {
309  return daal::algorithms::Result::serialImpl<Archive, onDeserialize>(arch);
310  }
311 
312 private:
317  DAAL_DEPRECATED services::Status checkValue(const Input *input) const;
318  /*
319  * \DAAL_DEPRECATED
320  */
321  DAAL_DEPRECATED services::Status checkAuxCoefficients(const Input *input) const;
322  /*
323  * \DAAL_DEPRECATED
324  */
325  DAAL_DEPRECATED services::Status checkAuxNumberOfCoefficients(const Input *input) const;
326 
327  /*
328  * \DAAL_DEPRECATED
329  */
330  DAAL_DEPRECATED LayerDataPtr getResultLayerDataAllocateIfEmpty();
331 
332  /*
333  * \DAAL_DEPRECATED
334  */
335  template<typename algorithmFPType>
336  DAAL_DEPRECATED services::Status allocateValueTensor(const Input *eltwiseInput);
337 };
338 
339 typedef services::SharedPtr<Result> ResultPtr;
340 } // namespace interface1
341 
342 using interface1::Input;
343 using interface1::Result;
344 using interface1::ResultPtr;
345 
346 } // namespace forward
348 } // namespace eltwise_sum
349 } // namespace layers
350 } // namespace neural_networks
351 } // namespace algorithms
352 } // namespace daal
353 
354 #endif
daal::algorithms::neural_networks::layers::eltwise_sum::LayerDataId
LayerDataId
Available identifiers of input tensors for the backward element-wise sum layer and identifiers of res...
Definition: eltwise_sum_layer_types.h:63
daal::algorithms::neural_networks::layers::eltwise_sum::LayerDataNumericTableId
LayerDataNumericTableId
Available identifiers of input numeric tables for the backward element-wise sum layer and identifiers...
Definition: eltwise_sum_layer_types.h:74
daal::algorithms::neural_networks::layers::eltwise_sum::forward::InputId
InputId
Definition: eltwise_sum_layer_forward_types.h:61
daal::algorithms::neural_networks::layers::eltwise_sum::forward::interface1::Input
Input objects for the forward element-wise sum layer
Definition: eltwise_sum_layer_forward_types.h:78
daal_defines.h
daal::algorithms::neural_networks::layers::forward::InputLayerDataId
InputLayerDataId
Definition: layer_forward_types.h:75
daal::algorithms::neural_networks::layers::eltwise_sum::forward::interface1::Result
Results obtained with the compute() method of the forward element-wise sum layer in the batch process...
Definition: eltwise_sum_layer_forward_types.h:193
daal::algorithms::math::abs::value
Definition: abs_types.h:88
daal::algorithms::neural_networks::layers::eltwise_sum::forward::coefficients
Definition: eltwise_sum_layer_forward_types.h:63

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