2 // Copyright (c) 2016 Intel Corporation
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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.
17 ///////////////////////////////////////////////////////////////////////////////////////////////////
22 /// @addtogroup c_api C API
24 /// @addtogroup c_topology Network Topology
26 /// @addtogroup c_primitives Primitives
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.
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
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
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).
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).
62 CLDNN_END_PRIMITIVE_DESC(crop)
64 CLDNN_DECLARE_PRIMITIVE_TYPE_ID(crop);