ConvertLike

Versioned name: ConvertLike-1

Category: type conversion

Short description: Operation converts all elements of the 1st input tensor to a type of elements of 2nd input tensor.

Attributes:

No attributes available.

Inputs

Outputs

Types

Detailed description

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 3.

a - data input tensor, b - like input tensor.

\[ o_{i} = Convert[destination_type=type(b)](a_{i}) \]

Examples

Example 1

<layer ... type="ConvertLike">
<input>
<port id="0">
<dim>256</dim>
<dim>56</dim>
</port>
<port id="1">
<dim>3</dim>
</port>
</input>
<output>
<port id="2">
<dim>256</dim>
<dim>56</dim>
</port>
</output>
</layer>