Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / thirdparty / clDNN / api / C / crop.h
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
17 ///////////////////////////////////////////////////////////////////////////////////////////////////
18 #ifndef CROP_H
19 #define CROP_H
20
21 #include "cldnn.h"
22 /// @addtogroup c_api C API
23 /// @{
24 /// @addtogroup c_topology Network Topology
25 /// @{
26 /// @addtogroup c_primitives Primitives
27 /// @{
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 /// @brief Performs crop operation on input.
34 /// @details Crops the input to the shape of reference_input across all dimensions taking into account specified input offsets.
35 /// @n       Borders variant calculated output shape from input shape minus the specified borders.
36 /// @n
37 /// @n\b Examples
38 /// @n Crop without offset example:
39 /// \image html crop_no_offset.jpg
40 /// @n Crop with offset example:
41 /// \image html crop_w_offset.jpg
42 /// @n
43 /// @n\b Requirements (reference size variant)
44 /// @n - Input size cannot be greater than reference size in any dimension
45 /// @n - All sizes have to have positive numbers
46 /// @n - Reference size plus offset cannot exceed input size
47 /// @n
48 /// @n\b Requirements (borders variant)
49 /// @n - Borders support batch, feature and spatial dimensions (rest of dimensions ignored).
50 /// @n - Input size cannot be greater than reference size in any dimension
51 /// @n - All sizes specified in borders have to have non-negative values (positive or @c 0).
52 /// @n - Sum of sizes of opposite borders must be lower than input size (on all non-ignored dimensions).
53 /// @n
54 /// @n Breaking any of this conditions will cause exception throw.
55 CLDNN_BEGIN_PRIMITIVE_DESC(crop)
56 /// @brief Reference input tensor with the required dimensions (if positive) or
57 ///        negated value of right/bottom/upper border size (if non-positive).
58 cldnn_tensor reference_input;
59 /// @brief Input offsets (reference_input is positive) or left/top/lower border
60 ///        size (reference_input is negative).
61 cldnn_tensor offsets;
62 CLDNN_END_PRIMITIVE_DESC(crop)
63
64 CLDNN_DECLARE_PRIMITIVE_TYPE_ID(crop);
65
66 #ifdef __cplusplus
67 }
68 #endif
69
70 /// @}
71 /// @}
72 /// @}
73 #endif /* CROP_H */
74