clDNN
crop.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/crop.h"
20 #include "primitive.hpp"
21 
22 namespace cldnn
23 {
30 
47 struct crop : public primitive_base<crop, CLDNN_PRIMITIVE_DESC(crop)>
48 {
49  CLDNN_DECLATE_PRIMITIVE(crop)
50 
51 
52  crop(
57  const primitive_id& id,
58  const primitive_id& input,
59  const tensor& reference_input,
60  const tensor& offsets,
61  const padding& output_padding = padding()
62  )
65  , offsets(offsets)
66  {
67  }
68 
70  crop(const dto* dto)
73  , offsets(dto->offsets)
74  {
75  }
76 
81 
82 protected:
83  void update_dto(dto& dto) const override
84  {
87  }
88 };
92 }
tensor reference_input
Reference input tensor with the required dimensions.
Definition: crop.hpp:78
Represents data padding information.
Definition: layout.hpp:125
Performs crop operation on input.
Definition: crop.h:49
N-dimensional vector. Mostly used to represent memory size.
Definition: tensor.hpp:256
cldnn_tensor offsets
Input offsets.
Definition: crop.h:53
cldnn_tensor reference_input
Reference input tensor with the required dimensions.
Definition: crop.h:51
Performs crop operation on input.
Definition: crop.hpp:47
tensor offsets
Input offsets.
Definition: crop.hpp:80
crop(const primitive_id &id, const primitive_id &input, const tensor &reference_input, const tensor &offsets, const padding &output_padding=padding())
Constructs crop primitive.
Definition: crop.hpp:56
crop(const dto *dto)
Constructs a copy from C API cldnn_crop_desc.
Definition: crop.hpp:70
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