clDNN
concatenation.hpp
1 /*
2 // Copyright (c) 2016 Intel Corporation
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 */
16 
18 #pragma once
19 #include "../C/concatenation.h"
20 #include "primitive.hpp"
21 
22 namespace cldnn
23 {
30 
53 struct concatenation : public primitive_base<concatenation, CLDNN_PRIMITIVE_DESC(concatenation)>
54 {
55  CLDNN_DECLATE_PRIMITIVE(concatenation)
56 
57  enum concatenation_axis
58  {
59  along_b = cldnn_concatenation_along_b,
60  along_f = cldnn_concatenation_along_f,
61  along_x = cldnn_concatenation_along_x,
62  along_y = cldnn_concatenation_along_y
63  };
64 
70  const primitive_id& id,
71  const std::vector<primitive_id>& input,
72  const concatenation_axis axis,
73  const padding& output_padding = padding()
74  )
76  , axis(axis)
77  {}
78 
82  , axis(static_cast<concatenation_axis>(dto->axis))
83  {}
84 
86  concatenation_axis axis;
87 
88 private:
89  void update_dto(dto& dto) const override
90  {
91  dto.axis = static_cast<cldnn_concatenation_axis>(axis);
92  }
93 };
97 }
concatenation_axis axis
Dimension along which concatenation should take place.
Represents data padding information.
Definition: layout.hpp:125
cldnn_concatenation_axis axis
Dimension along which concatenation should take place.
Definition: concatenation.h:63
concatenation(const primitive_id &id, const std::vector< primitive_id > &input, const concatenation_axis axis, const padding &output_padding=padding())
const primitive_id id
Primitive&#39;s id.
Definition: primitive.hpp:143
concatenation(const dto *dto)
Constructs a copy from C API (depth_concatenate)
std::string primitive_id
Unique id of a primitive within a topology.
Definition: primitive.hpp:42
fixed_size_vector_ref input
List of ids of input primitives.
Definition: primitive.hpp:146
base class for all primitives implementations.
Definition: primitive.hpp:190
padding output_padding
Requested output padding.
Definition: primitive.hpp:149