19 #include "../C/convolution.h" 20 #include "primitive.hpp" 53 const std::vector<primitive_id>&
weights,
54 const std::vector<primitive_id>&
bias,
59 float activation_slp = 0.0f,
75 throw std::runtime_error(
"convolution's weights/bias count does not match");
92 const std::vector<primitive_id>&
weights,
97 float activation_slp = 0.0f,
102 ,
bias(_bias.cpp_ids)
110 , _bias(std::vector<primitive_id>(0))
130 const std::vector<primitive_id>&
weights,
131 const std::vector<primitive_id>&
bias,
136 float activation_slp,
142 ,
bias(_bias.cpp_ids)
154 throw std::runtime_error(
"convolution's weights/bias count does not match");
172 const std::vector<primitive_id>&
weights,
177 float activation_slp,
183 ,
bias(_bias.cpp_ids)
192 , _bias(std::vector<primitive_id>(0))
200 ,
bias(_bias.cpp_ids)
212 throw std::invalid_argument(
"Invalid convolution dto: bad split value");
232 const std::vector<primitive_id>&
weights,
233 const std::vector<primitive_id>&
bias,
239 float activation_slp = 0.0f,
263 const std::vector<primitive_id>&
weights,
269 float activation_slp = 0.0f,
302 primitive_id_arr _weights;
303 primitive_id_arr _bias;
305 std::vector<std::reference_wrapper<const primitive_id>> get_dependencies()
const override 307 std::vector<std::reference_wrapper<const primitive_id>> ret;
317 void update_dto(dto& dto)
const override 319 dto.weights = _weights.ref();
320 dto.bias = _bias.ref();
convolution(const primitive_id &id, const primitive_id &input, const std::vector< primitive_id > &weights, tensor stride, tensor input_offset, tensor dilation, bool with_activation, float activation_slp, tensor output_size, const padding &output_padding=padding())
Constructs convolution primitive (w/o bias; computes input paddings to match output size)...
fixed_size_vector_ref bias
List of primitive ids containing bias data.
tensor output_size
User-defined output data size of the primitive (w/o padding).
Represents data padding information.
static convolution create_with_output_size(const primitive_id &id, const primitive_id &input, const std::vector< primitive_id > &weights, tensor output_size, tensor stride={ 1, 1, 1, 1 }, tensor input_offset={ 0, 0, 0, 0 }, tensor dilation={ 1, 1, 1, 1 }, bool with_activation=false, float activation_slp=0.0f, const padding &output_padding=padding())
Constructs convolution primitive (w/o bias; computes input paddings to match output size)...
convolution(const primitive_id &id, const primitive_id &input, const std::vector< primitive_id > &weights, tensor stride={ 1, 1, 1, 1 }, tensor input_offset={ 0, 0, 0, 0 }, tensor dilation={ 1, 1, 1, 1 }, bool with_activation=false, float activation_slp=0.0f, const padding &output_padding=padding())
Constructs convolution primitive (w/o bias).
N-dimensional vector. Mostly used to represent memory size.
tensor dilation
Defines gaps in the input - dilation rate k=1 is normal convolution, k=2 means skipping one pixel per...
convolution(const primitive_id &id, const primitive_id &input, const std::vector< primitive_id > &weights, const std::vector< primitive_id > &bias, tensor stride, tensor input_offset, tensor dilation, bool with_activation, float activation_slp, tensor output_size, const padding &output_padding=padding())
Constructs convolution primitive (computes input paddings to match output size).
float activation_negative_slope
Relu activation slope.
const primitive_id id
Primitive's id.
tensor input_offset
Defines a shift, relative to (0,0) position of the input buffer, where (0,0) point of the convolution...
uint32_t split
On how many cards split the computation to.
convolution(const dto *dto)
Constructs a copy from C API cldnn_convolution_desc.
tensor stride
Defines shift in input buffer between adjacent calculations of output values.
int32_t split() const
On how many cards split the computation to.
convolution(const primitive_id &id, const primitive_id &input, const std::vector< primitive_id > &weights, const std::vector< primitive_id > &bias, tensor stride={ 1, 1, 1, 1 }, tensor input_offset={ 0, 0, 0, 0 }, tensor dilation={ 1, 1, 1, 1 }, bool with_activation=false, float activation_slp=0.0f, const padding &output_padding=padding())
Constructs convolution primitive.
fixed_size_vector_ref weights
List of primitive ids containing weights data.
std::string primitive_id
Unique id of a primitive within a topology.
static convolution create_with_output_size(const primitive_id &id, const primitive_id &input, const std::vector< primitive_id > &weights, const std::vector< primitive_id > &bias, tensor output_size, tensor stride={ 1, 1, 1, 1 }, tensor input_offset={ 0, 0, 0, 0 }, tensor dilation={ 1, 1, 1, 1 }, bool with_activation=false, float activation_slp=0.0f, const padding &output_padding=padding())
Constructs convolution primitive (computes input paddings to match output size).
Performs forward spatial convolution with weight sharing. Also supports built-in Relu cldnn_activatio...
bool with_output_size
Indicates that the primitive has user-defined output size (non-zero value).
fixed_size_vector_ref input
List of ids of input primitives.
bool with_activation
Enable Relu activation.
base class for all primitives implementations.
padding output_padding
Requested output padding.
Initialize fields common for all primitives.
Performs forward spatial convolution with weight sharing. Also supports built-in Relu cldnn_activatio...