|
Open Deep Learning API
|
Go to the source code of this file.
Enumerations | |
| enum | odla_interpolation_mode { ODLA_NEAREST , ODLA_LINEAR , ODLA_CUBIC } |
| Interpolation methods. More... | |
| enum | odla_resize_coordinate_mode { ODLA_ASSYMMETRIC , ODLA_HALF_PIXEL , ODLA_HALF_PIXEL_TF , ODLA_ALIGN_CORNERS } |
| Modes for coordinate transformation during resizing. More... | |
| enum | odla_fill_method { ODLA_EyeLike , ODLA_RandomNormal , ODLA_RandomUniform } |
| Methods for filling a value. More... | |
Functions | |
| ODLA_API_EXPORT odla_value ODLA_API_CALL | odla_Broadcast (const odla_value input, odla_value_shape output_shape, const odla_value_id value_id) |
| Broadcast the value. More... | |
| ODLA_API_EXPORT odla_value ODLA_API_CALL | odla_Cast (odla_value input, odla_element_type target_type, const odla_value_id value_id) |
| cast the element data type of an input More... | |
| ODLA_API_EXPORT odla_value ODLA_API_CALL | odla_Compress (odla_value input, odla_value condition, odla_int32 axis, odla_value_shape max_output_shape, const odla_value_id value_id) |
| Select slices based on condition. More... | |
| ODLA_API_EXPORT odla_value ODLA_API_CALL | odla_Concat (odla_values inputs, odla_int32 axis, odla_value_shape output_shape, const odla_value_id value_id) |
| Concatenate multiple values into a single value. More... | |
| ODLA_API_EXPORT odla_value ODLA_API_CALL | odla_ExpandDims (odla_value input, odla_value_shape output_dims, const odla_value_id value_id) |
| Broadcast the input tensor. More... | |
| ODLA_API_EXPORT odla_value ODLA_API_CALL | odla_Fill (odla_value_type type, odla_fill_method method, odla_float32 p0, odla_float32 p1, odla_float32 seed, const odla_value_id value_id) |
| Generate a value with data. More... | |
| ODLA_API_EXPORT odla_value ODLA_API_CALL | odla_Gather (odla_value input, odla_value indices, odla_int32 axis, odla_value_shape output_dims, const odla_value_id value_id) |
| Gather slices. More... | |
| ODLA_API_EXPORT odla_value ODLA_API_CALL | odla_GatherND (odla_value input, odla_value indices, odla_int32 num_batch_dims, odla_value_shape output_dims, const odla_value_id value_id) |
| Gather slices. More... | |
| ODLA_API_EXPORT odla_value ODLA_API_CALL | odla_GatherElements (odla_value input, odla_value indices, odla_int32 axis, odla_value_shape output_dims, const odla_value_id value_id) |
| Gather elements. More... | |
| ODLA_API_EXPORT odla_value ODLA_API_CALL | odla_OneHot (odla_value indices, odla_int32 depth, odla_value values, odla_int32 axis, odla_value_shape output_dims, const odla_value_id value_id) |
| one-hot value More... | |
| ODLA_API_EXPORT odla_value ODLA_API_CALL | odla_Pad (odla_value input, const odla_uint32 *padding_front, const odla_uint32 *padding_back, odla_value_shape output_dims, const odla_value_id value_id) |
| Pad the input. More... | |
| ODLA_API_EXPORT odla_value ODLA_API_CALL | odla_Reshape (odla_value input, odla_value_shape output_dims, const odla_value_id value_id) |
| Reshape a value. More... | |
| ODLA_API_EXPORT odla_value ODLA_API_CALL | odla_ReshapeDynamic (odla_value input, odla_value output_shape, const odla_value_id value_id) |
| Reshape a value. More... | |
| ODLA_API_EXPORT odla_value ODLA_API_CALL | odla_Resize (odla_value input, odla_interpolation_mode interpolation, odla_resize_coordinate_mode mode, odla_uint32 axes_mask, odla_value_shape output_dims, const odla_value_id value_id) |
| Resize by interpolating. More... | |
| ODLA_API_EXPORT odla_value ODLA_API_CALL | odla_ResizeDynamic (odla_value input, odla_value scales, odla_value sizes, odla_interpolation_mode interpolation, odla_resize_coordinate_mode mode, odla_value_shape output_dims, const odla_value_id value_id) |
| Resize by interpolating (dynamic shape) More... | |
| ODLA_API_EXPORT odla_value ODLA_API_CALL | odla_Shape (odla_value input, odla_value_shape output_dims, const odla_value_id value_id) |
| Get the shape of input. More... | |
| ODLA_API_EXPORT odla_value ODLA_API_CALL | odla_Slice (odla_value input, const odla_int32 *start, const odla_int32 *end, const odla_int32 *stride, odla_value_shape output_dims, const odla_value_id value_id) |
| Extract a slice. More... | |
| ODLA_API_EXPORT odla_value ODLA_API_CALL | odla_DimsExpand (odla_value input, odla_value original, odla_value axes, odla_value_shape output_dims, const odla_value_id id) |
| Extract a DimsExpand. More... | |
| ODLA_API_EXPORT odla_value ODLA_API_CALL | odla_SliceDynamic (odla_value input, odla_value start, odla_value size, odla_value stride, odla_value_shape output_dims, const odla_value_id value_id) |
| Extract a dynamic slice. More... | |
| ODLA_API_EXPORT odla_values ODLA_API_CALL | odla_Split (odla_value input, odla_value split_dim, odla_int32 num_split, const odla_value_ids value_ids) |
| Splits a tensor into num_split tensors along one dimension. More... | |
| ODLA_API_EXPORT odla_value ODLA_API_CALL | odla_Squeeze (odla_value input, odla_size_t num_of_axes, const odla_uint32 *axes, odla_value_shape output_dims, const odla_value_id value_id) |
| Remove dimensions of size 1. More... | |
| ODLA_API_EXPORT odla_value ODLA_API_CALL | odla_Stack (odla_values inputs, odla_int32 axis, odla_value_shape output_shape, const odla_value_id value_id) |
| Join a sequence of Values along a new axis. More... | |
| ODLA_API_EXPORT odla_value ODLA_API_CALL | odla_Transpose (odla_value input, odla_value_shape permutations, odla_value_shape output_dims, const odla_value_id value_id) |
| Transpose the input. More... | |
| ODLA_API_EXPORT odla_value ODLA_API_CALL | odla_Tile (odla_value input, const odla_uint32 *repeat, odla_value_shape output_dims, const odla_value_id value_id) |
| Tile input multiples times. More... | |
| ODLA_API_EXPORT odla_value ODLA_API_CALL | odla_TileDynamic (odla_value input, odla_value repeat, odla_value_shape output_dims, const odla_value_id value_id) |
| Tile input multiples times dynamically. More... | |
This file defines the ODLA value process replated operators.
Definition in file odla_ops_process.h.
| enum odla_fill_method |
Methods for filling a value.
| Enumerator | |
|---|---|
| ODLA_EyeLike | ones on the diagnoal and zeros elsewhere. |
| ODLA_RandomNormal | normal distribution. |
| ODLA_RandomUniform | random uniform distrubution. |
Definition at line 49 of file odla_ops_process.h.
Interpolation methods.
| Enumerator | |
|---|---|
| ODLA_NEAREST | nearest-neighbor interpolation. |
| ODLA_LINEAR | N-Linear interpolation. E.g. bilinear for 2D plane. |
| ODLA_CUBIC | N-Cubic interpolation .E.g. bicubic for 2D plane. |
Definition at line 33 of file odla_ops_process.h.
Modes for coordinate transformation during resizing.
Definition at line 40 of file odla_ops_process.h.
| ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Broadcast | ( | const odla_value | input, |
| odla_value_shape | output_shape, | ||
| const odla_value_id | value_id | ||
| ) |
Broadcast the value.
Broadcast broadcasts the input based on output_shape.
| input | the input value |
| output_shape | the shape after broadcasting |
| value_id | a unique value id (can be NULL) |
| ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Cast | ( | odla_value | input, |
| odla_element_type | target_type, | ||
| const odla_value_id | value_id | ||
| ) |
cast the element data type of an input
Cast casts the input element type to target_type.
| input | the input value |
| target_type | the data type of casted value |
| value_id | a unique value id (can be NULL) |
| ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Compress | ( | odla_value | input, |
| odla_value | condition, | ||
| odla_int32 | axis, | ||
| odla_value_shape | max_output_shape, | ||
| const odla_value_id | value_id | ||
| ) |
Select slices based on condition.
Select slices from input along specified axis based on condition vector.
| input | the input value |
| condition | the condition value (1-D) |
| axis | the axis on which the slices to be selected |
| max_output_shape | the maximum result shape (assume all conditions are true) |
| value_id | a unique value id (can be NULL) |
| ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Concat | ( | odla_values | inputs, |
| odla_int32 | axis, | ||
| odla_value_shape | output_shape, | ||
| const odla_value_id | value_id | ||
| ) |
Concatenate multiple values into a single value.
Concat concatenates multiple values into single one. All inputs must have the same dimension except for the dimension size of the axis to concatenate on.
| inputs | the input values |
| axis | the axis on which the inputs to be concatenated |
| output_shape | the result shape |
| value_id | a unique value id (can be NULL) |
| ODLA_API_EXPORT odla_value ODLA_API_CALL odla_DimsExpand | ( | odla_value | input, |
| odla_value | original, | ||
| odla_value | axes, | ||
| odla_value_shape | output_dims, | ||
| const odla_value_id | id | ||
| ) |
Extract a DimsExpand.
odla_Axes_cal extracts a DimsExpand from axes.
| input | the input value |
| original | the original value |
| axes | the axes to slice |
| value_id | a unique value id (can be NULL) |
| ODLA_API_EXPORT odla_value ODLA_API_CALL odla_ExpandDims | ( | odla_value | input, |
| odla_value_shape | output_dims, | ||
| const odla_value_id | value_id | ||
| ) |
Broadcast the input tensor.
ExpandDims broadcast the input tensor into the shape of output_dims .
| input | the input value |
| output_dims | the output shape |
| value_id | a unique value id (can be NULL) |
| ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Fill | ( | odla_value_type | type, |
| odla_fill_method | method, | ||
| odla_float32 | p0, | ||
| odla_float32 | p1, | ||
| odla_float32 | seed, | ||
| const odla_value_id | value_id | ||
| ) |
Generate a value with data.
Fill genrates a value with type and dimensions sepecified by type and fill it with data as using the specified method. When filling with normal distribution, p0 and p1 are for mean and standard deviation, respectively. When filling with unform distribution, p0 and p1 are for the lower and upper bounds, respectively. For othere filling methods, p0 and p1 are ignored.
| type | the type of generated odla_value |
| method | the method for filling the value |
| p0 | mean for normal distribution, or lower bound for uniform distribution |
| p1 | stddev for normal distribution, or upper bound for uniform distribution |
| seed | the seed to the random generator |
| value_id | a unique value id (can be NULL) |
| ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Gather | ( | odla_value | input, |
| odla_value | indices, | ||
| odla_int32 | axis, | ||
| odla_value_shape | output_dims, | ||
| const odla_value_id | value_id | ||
| ) |
Gather slices.
Gather slices from input according to indices.
| input | the input value |
| indices | the indices value |
| axis | the axis on which the input is to gather |
| output_dims | the optional output shape (can be undefined) |
| value_id | a unique value id (can be NULL) |
| ODLA_API_EXPORT odla_value ODLA_API_CALL odla_GatherElements | ( | odla_value | input, |
| odla_value | indices, | ||
| odla_int32 | axis, | ||
| odla_value_shape | output_dims, | ||
| const odla_value_id | value_id | ||
| ) |
Gather elements.
Gather slices from input according to indices.
| input | the input value |
| indices | the indices value |
| axis | the axis on which the input is to gather |
| output_dims | the optional output shape (can be undefined) |
| value_id | a unique value id (can be NULL) |
| ODLA_API_EXPORT odla_value ODLA_API_CALL odla_GatherND | ( | odla_value | input, |
| odla_value | indices, | ||
| odla_int32 | num_batch_dims, | ||
| odla_value_shape | output_dims, | ||
| const odla_value_id | value_id | ||
| ) |
Gather slices.
Gather slices from input according to indices.
| input | the input value |
| indices | the indices value |
| num_batch_dims | the number of leading dimensions to be omitted |
| output_dims | the optional output shape (can be undefined) |
| value_id | a unique value id (can be NULL) |
| ODLA_API_EXPORT odla_value ODLA_API_CALL odla_OneHot | ( | odla_value | indices, |
| odla_int32 | depth, | ||
| odla_value | values, | ||
| odla_int32 | axis, | ||
| odla_value_shape | output_dims, | ||
| const odla_value_id | value_id | ||
| ) |
one-hot value
OneHot returns a one-hot value from values based on indices and depth.
| indices | the indices of "on value" |
| depth | the size of the new dimension |
| values | the pair of off and on values |
| axis | the axis of new dimension on |
| output_dims | the optional output shape (can be undefined) |
| value_id | a unique value id (can be NULL) |
| ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Pad | ( | odla_value | input, |
| const odla_uint32 * | padding_front, | ||
| const odla_uint32 * | padding_back, | ||
| odla_value_shape | output_dims, | ||
| const odla_value_id | value_id | ||
| ) |
Pad the input.
Pad pads the input with given padding amount.
| input | the input value |
| padding_front | the padding amount applied to the start of input |
| padding_back | the padding amount applied to the end of input |
| output_dims | the optional output shape (can be undefined) |
| value_id | a unique value id (can be NULL) |
| ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Reshape | ( | odla_value | input, |
| odla_value_shape | output_dims, | ||
| const odla_value_id | value_id | ||
| ) |
Reshape a value.
Reshape reshapes the input with a new dimension specified by output_dims.
| input | the input value |
| output_dims | the output shape |
| value_id | a unique value id (can be NULL) |
| ODLA_API_EXPORT odla_value ODLA_API_CALL odla_ReshapeDynamic | ( | odla_value | input, |
| odla_value | output_shape, | ||
| const odla_value_id | value_id | ||
| ) |
Reshape a value.
ReshapeDynamic reshapes the input with a new dimension specified by output_shape.
| input | the input value |
| output_shape | the output shape |
| value_id | a unique value id (can be NULL) |
| ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Resize | ( | odla_value | input, |
| odla_interpolation_mode | interpolation, | ||
| odla_resize_coordinate_mode | mode, | ||
| odla_uint32 | axes_mask, | ||
| odla_value_shape | output_dims, | ||
| const odla_value_id | value_id | ||
| ) |
Resize by interpolating.
Resize resizes the input using specified interploation method.
| input | the input value |
| interpolation | the interpolation method |
| mode | the coordinate transformation mode |
| axes_mask | the mask that indicates which axes need to be resized. The LSB corresponds to the shape dimension with stride of 1. For example, to resize a tensor in NHWC layout, the mask would be 0b0110. |
| output_dims | the optional output shape (can be undefined) |
| value_id | a unique value id (can be NULL) |
| ODLA_API_EXPORT odla_value ODLA_API_CALL odla_ResizeDynamic | ( | odla_value | input, |
| odla_value | scales, | ||
| odla_value | sizes, | ||
| odla_interpolation_mode | interpolation, | ||
| odla_resize_coordinate_mode | mode, | ||
| odla_value_shape | output_dims, | ||
| const odla_value_id | value_id | ||
| ) |
Resize by interpolating (dynamic shape)
Resize resizes the input using specified interpolation method. The shape of output is determined by either scales or sizes. It is an error if both are specified (non-null).
| input | the input value |
| scales | the scaling value |
| sizes | the size of output value |
| interpolation | the interpolation method |
| mode | the coordinate transformation mode |
| output_dims | the optional output shape (can be undefined) |
| value_id | a unique value id (can be NULL) |
| ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Shape | ( | odla_value | input, |
| odla_value_shape | output_dims, | ||
| const odla_value_id | value_id | ||
| ) |
Get the shape of input.
Shape returns the shape of input as a 1D odla_value. The element type of the result value is implementation determined.
| input | the input value |
| output_dims | the optional output shape (can be undefined) |
| value_id | a unique value id (can be NULL) |
| ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Slice | ( | odla_value | input, |
| const odla_int32 * | start, | ||
| const odla_int32 * | end, | ||
| const odla_int32 * | stride, | ||
| odla_value_shape | output_dims, | ||
| const odla_value_id | value_id | ||
| ) |
Extract a slice.
Slice extracts a slice from input.
| input | the input value |
| start | the offets at each slicing dimension |
| end | the ending indices(exclusive) at each slicing dimension |
| stride | the stride at each slicing dimension |
| output_dims | the optional output shape (can be undefined) |
| value_id | a unique value id (can be NULL) |
| ODLA_API_EXPORT odla_value ODLA_API_CALL odla_SliceDynamic | ( | odla_value | input, |
| odla_value | start, | ||
| odla_value | size, | ||
| odla_value | stride, | ||
| odla_value_shape | output_dims, | ||
| const odla_value_id | value_id | ||
| ) |
Extract a dynamic slice.
SliceDynamic extracts a dynamic slice from input.
| input | the input value |
| start | the offets at each slicing dimension |
| size | the number of elements at each slicing dimension |
| stride | the stride at each slicing dimension |
| output_dims | the optional output shape (can be undefined) |
| value_id | a unique value id (can be NULL) |
| ODLA_API_EXPORT odla_values ODLA_API_CALL odla_Split | ( | odla_value | input, |
| odla_value | split_dim, | ||
| odla_int32 | num_split, | ||
| const odla_value_ids | value_ids | ||
| ) |
Splits a tensor into num_split tensors along one dimension.
Split extracts a slice from input.
| input | the input value |
| split_dim | the dimension along which to split |
| num_split | the number of ways to split |
| value_ids | an array of values ids (can be NULL) |
| ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Squeeze | ( | odla_value | input, |
| odla_size_t | num_of_axes, | ||
| const odla_uint32 * | axes, | ||
| odla_value_shape | output_dims, | ||
| const odla_value_id | value_id | ||
| ) |
Remove dimensions of size 1.
Squeeze removes dimensions of size 1 from the shape of input. All single dimensions will be squeezed if num_of_axes is zero.
| input | the input value |
| num_of_axes | nubmer of axes to squeeze |
| axes | the axes to squeeze |
| output_dims | the optional output shape (can be undefined) |
| value_id | a unique value id (can be NULL) |
| ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Stack | ( | odla_values | inputs, |
| odla_int32 | axis, | ||
| odla_value_shape | output_shape, | ||
| const odla_value_id | value_id | ||
| ) |
Join a sequence of Values along a new axis.
Stack joins multiple values into single one along a new axis. All inputs must have the same dimension.
| inputs | the input values |
| axis | the index of the new axis in the dimensions of the result |
| output_shape | the result shape |
| value_id | a unique value id (can be NULL) |
| ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Tile | ( | odla_value | input, |
| const odla_uint32 * | repeat, | ||
| odla_value_shape | output_dims, | ||
| const odla_value_id | value_id | ||
| ) |
Tile input multiples times.
Replicate a given input value multiples times.
| input | the input value |
| repeat | the dimension numbers of repeated copies along input's dimensions. |
| output_dims | the optional output shape (can be undefined) |
| value_id | a unique value id (can be NULL) |
| ODLA_API_EXPORT odla_value ODLA_API_CALL odla_TileDynamic | ( | odla_value | input, |
| odla_value | repeat, | ||
| odla_value_shape | output_dims, | ||
| const odla_value_id | value_id | ||
| ) |
Tile input multiples times dynamically.
Replicate a given input value multiples times dynamically.
| input | the input value |
| repeat | the dimension numbers of repeated copies along input's dimensions. |
| output_dims | the optional output shape (can be undefined) |
| value_id | a unique value id (can be NULL) |
| ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Transpose | ( | odla_value | input, |
| odla_value_shape | permutations, | ||
| odla_value_shape | output_dims, | ||
| const odla_value_id | value_id | ||
| ) |
Transpose the input.
Transpose returns a transposed value based on the permutation.
| input | the input value |
| permutations | the axies for permutation. It should be the same size as input_dims and output_dims |
| output_dims | the optional output shape (can be undefined) |
| value_id | a unique value id (can be NULL) |