clDNN
upsampling.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/upsampling.h"
20 #include "primitive.hpp"
21 
22 namespace cldnn
23 {
30 
32 enum class upsampling_sample_type : int32_t
33 {
38 };
39 
42 struct upsampling : public primitive_base<upsampling, CLDNN_PRIMITIVE_DESC(upsampling)>
43 {
44  CLDNN_DECLATE_PRIMITIVE(upsampling)
45 
46 
47  upsampling(
55  const primitive_id& id,
56  const primitive_id& input,
57  uint32_t scale,
58  uint32_t num_filter,
60  bool with_activation = false,
61  float activation_slp = 0.0f,
62  const padding& output_padding = padding()
63  )
65  , scale(scale)
69  , activation_negative_slope(activation_slp)
70  {
71  }
72 
74  upsampling(const dto* dto)
76  , scale(dto->scale)
81  {
82  }
83 
85  uint32_t scale;
87  uint32_t num_filter;
94 
95 protected:
96  void update_dto(dto& dto) const override
97  {
98  dto.scale = scale;
103  }
104 };
108 }
uint32_t num_filter
Definition: upsampling.hpp:87
upsampling(const dto *dto)
Constructs a copy from C API cldnn_upsampling_desc.
Definition: upsampling.hpp:74
upsampling bilinear.
Definition: upsampling.h:39
bool with_activation
Enables Relu activation.
Definition: upsampling.hpp:91
upsampling nearest neighbor.
Definition: upsampling.h:37
Represents data padding information.
Definition: layout.hpp:125
Performs elementwise product of input and scale_input.
Definition: scale.hpp:44
float activation_negative_slope
Relu activation slope.
Definition: upsampling.h:54
upsampling nearest neighbor.
upsampling(const primitive_id &id, const primitive_id &input, uint32_t scale, uint32_t num_filter, upsampling_sample_type sample_type, bool with_activation=false, float activation_slp=0.0f, const padding &output_padding=padding())
Constructs upsampling primitive.
Definition: upsampling.hpp:54
upsampling_sample_type
Sample mode for the upsampling layer.
Definition: upsampling.hpp:32
Performs nearest neighbor/bilinear upsampling Also supports built-in Relu activation available by set...
Definition: upsampling.h:44
uint32_t with_activation
Enables Relu activation.
Definition: upsampling.h:52
cldnn_upsampling_sample_type
Sample mode for upsampling layer ( cldnn_upsampling_desc ​).
Definition: upsampling.h:34
Performs nearest neighbor/bilinear upsampling Also supports built-in Relu activation available by set...
Definition: upsampling.hpp:42
float activation_negative_slope
Relu activation slope.
Definition: upsampling.hpp:93
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
upsampling_sample_type sample_type
Definition: upsampling.hpp:89
base class for all primitives implementations.
Definition: primitive.hpp:190
padding output_padding
Requested output padding.
Definition: primitive.hpp:149