clDNN
permute.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/permute.h"
20 #include "primitive.hpp"
21 
22 namespace cldnn
23 {
30 
39 struct permute : public primitive_base<permute, CLDNN_PRIMITIVE_DESC(permute)>
40 {
41  CLDNN_DECLATE_PRIMITIVE(permute)
42 
43 
44  permute(
48  const primitive_id& id,
49  const primitive_id& input,
50  const std::vector<uint16_t>& permute_order = {},
51  const padding& output_padding = padding()
52  )
55  {
56  }
57 
59  permute(const dto* dto)
61  , permute_order(uint16_t_arr_to_vector(dto->permute_order))
62  {
63  }
64 
66  std::vector<uint16_t> permute_order;
67 
68 protected:
69  void update_dto(dto& dto) const override
70  {
71  dto.permute_order = uint16_t_vector_to_arr(permute_order);
72  }
73 };
77 }
permute(const dto *dto)
Constructs a copy from basic C API cldnn_reorder_desc.
Definition: permute.hpp:59
Represents data padding information.
Definition: layout.hpp:125
permute(const primitive_id &id, const primitive_id &input, const std::vector< uint16_t > &permute_order={}, const padding &output_padding=padding())
Constructs permute primitive.
Definition: permute.hpp:47
cldnn_uint16_t_arr permute_order
Array of permuted output order in bfyx format.
Definition: permute.h:43
Permutes data in the memory, with respect to provided order.
Definition: permute.h:41
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
Permutes data in the memory, with respect to provided order.
Definition: permute.hpp:39
padding output_padding
Requested output padding.
Definition: primitive.hpp:149
std::vector< uint16_t > permute_order
Array of permuted output order in bfyx format.
Definition: permute.hpp:66