Versioned name: Convert-1
Category: Type conversion
Short description: Convert operation performs element-wise conversion on a given input tensor to a type specified in the destination_type attribute.
Conversion from one supported type to another supported type is always allowed. User must be aware of precision loss and value change caused by range difference between two types. For example, a 32-bit float
3.141592 may be round to a 32-bit int
Conversion of negative signed integer to unsigned integer value happens in accordance with c++ standard. Notably, result is the unique value of the destination unsigned type that is congruent to the source integer modulo 2^N (where N is the bit width of the destination type). For example, when an int32 value
-1 is converted to uint32 the result will be
uint32 max which is
The result of unsupported conversions is undefined. Output elements are represented as follows:
a corresponds to the input tensor.
Description: the destination type.
Range of values: one of the supported types T
1: A tensor of type T and arbitrary shape. Required.
1: The result of element-wise Convert operation. A tensor of destination_type type and the same shape as input tensor.
T: any supported type
<layer ... type="Convert"> <data destination_type="f32"/> <input> <port id="0"> < !-- type: i32 --> <dim>256</dim> <dim>56</dim> </port> </input> <output> <port id="1"> < !-- result type: f32 --> <dim>256</dim> <dim>56</dim> </port> </output> </layer>