clDNN
cldnn::split Struct Reference

Performs split operation on input. More...

#include <split.hpp>

Inheritance diagram for cldnn::split:
Collaboration diagram for cldnn::split:

Public Types

typedef cldnn_split_desc dto
 

Public Member Functions

 split (const primitive_id &id, const primitive_id &input, const std::vector< std::pair< primitive_id, tensor > > &output_ids_offsets, const padding &output_padding=padding())
 Constructs split primitive. More...
 
 split (const dto *dto)
 Constructs a copy from C API cldnn_split_desc.
 
- Public Member Functions inherited from cldnn::primitive_base< split, cldnn_split_desc >
const cldnn_primitive_descget_dto () const override
 Returns pointer to a C API primitive descriptor casted to cldnn_primitive_desc.
 
- Public Member Functions inherited from cldnn::primitive
 primitive (const primitive_type_id &type, const primitive_id &id, const std::vector< primitive_id > &input, const padding &output_padding=padding())
 
 primitive (const cldnn_primitive_desc *dto)
 Constructs a copy from basic C API cldnn_primitive_desc.
 
std::vector< std::reference_wrapper< primitive_id > > dependecies ()
 Returns references to all primitive ids on which this primitive depends - inputs, weights, biases, etc.
 
std::vector< primitive_iddependecies () const
 Returns copy of all primitive ids on which this primitive depends - inputs, weights, biases, etc.
 
 operator primitive_id () const
 Implicit conversion to primiitive id.
 

Static Public Member Functions

static primitive_type_id type_id ()
 

Public Attributes

fixed_size_vector_ref output_ids
 List of output_ids.
 
std::vector< tensoroutput_offsets
 Array of tensors with offsets.
 
- Public Attributes inherited from cldnn::primitive
const primitive_type_id type
 Primitive's type id.
 
const primitive_id id
 Primitive's id.
 
fixed_size_vector_ref input
 List of ids of input primitives.
 
padding output_padding
 Requested output padding.
 

Protected Member Functions

void update_dto (dto &dto) const override
 
- Protected Member Functions inherited from cldnn::primitive_base< split, cldnn_split_desc >
 primitive_base (const primitive_id &id, const std::vector< primitive_id > &input, const padding &output_padding=padding())
 
 primitive_base (const cldnn_split_desc *dto)
 
- Protected Member Functions inherited from cldnn::primitive
virtual std::vector< std::reference_wrapper< const primitive_id > > get_dependencies () const
 

Static Protected Member Functions

static std::vector< primitive_idextract_primitive_vector (const std::vector< std::pair< primitive_id, tensor > > &stor)
 
static std::vector< tensorextract_tensor_vector (const std::vector< std::pair< primitive_id, tensor > > &stor)
 
static std::vector< tensortensor_arr_to_vector (const cldnn_tensor_arr &arr)
 
static std::vector< cldnn_tensortensor_arr_to_cldnn_vector (const cldnn_tensor_arr &arr)
 
static std::vector< cldnn_tensortensor_vector_to_cldnn_vector (const std::vector< tensor > &stor)
 

Protected Attributes

primitive_id_arr _output_ids
 
std::vector< cldnn_tensor_output_offsets
 
- Protected Attributes inherited from cldnn::primitive
primitive_id_arr _input
 

Detailed Description

Performs split operation on input.

splits the input data into n parts, for each user provides name and offsets.
User cannot use split primitive directly.
It is needed to refer to the output ids with the name "<split_prim_id>:<split_output_id>".

Assumptions
- offsets1 < offsets2 < offsets3 < ...
- size[n] = offsets[n+1] - offsets[n];
- last element: size[n] = split_input.size - offsets[n];
- no buffer overlapping, as the output size is calculated using offset and input size
- split primitive id cannot be used by any other primitive (user needs to use output_ids only)
Breaking any of this conditions will cause exeption throw.

Example:
Splitting output to 2 parts by the features:
input_size = { 2, 4, 3, 5 };
split_id = "split";
output_ids_offsets[0] = { "out0", { 0,0,0,0 } };
output_ids_offsets[1] = { "out1", { 0,2,0,0 } };
After split there would be 2 primitives: "split:out0" and "split:out1" which contain 2 feature maps (lower and upper)

Definition at line 51 of file split.hpp.

Constructor & Destructor Documentation

◆ split()

cldnn::split::split ( const primitive_id id,
const primitive_id input,
const std::vector< std::pair< primitive_id, tensor > > &  output_ids_offsets,
const padding output_padding = padding() 
)
inline

Constructs split primitive.

Parameters
idThis primitive id.
inputInput primitive id.
output_ids_offsetsPairs of output_ids and offsets

Definition at line 59 of file split.hpp.


The documentation for this struct was generated from the following file: