Convert type🔗

Changes the data type of the input object or converts a string to a number.

Input🔗

  • input: A scalar, a matrix, a tensor or a string. Accepted types depend on outputType: a scalar output type requires a scalar or string as an input, a matrix output type requires matrix input etc.

  • outputType: The type of the output.

  • roundingMode: The way floating-point values are converted to integers.

Outputs🔗

  • output: The converted value.

enum OutputType🔗

Type of the output is scalar, matrix or tensor.

Values:

enumerator Bool🔗
enumerator Int32🔗
enumerator Float🔗
enumerator Double🔗
enumerator FComplex🔗
enumerator DComplex🔗
enumerator BoolMatrix🔗
enumerator Int32Matrix🔗
enumerator FloatMatrix🔗
enumerator DoubleMatrix🔗
enumerator FComplexMatrix🔗
enumerator DComplexMatrix🔗
enumerator BoolTensor🔗
enumerator Int8Tensor🔗
enumerator Uint8Tensor🔗
enumerator Int16Tensor🔗
enumerator Uint16Tensor🔗
enumerator Int32Tensor🔗
enumerator Uint32Tensor🔗
enumerator Int64Tensor🔗
enumerator Uint64Tensor🔗
enumerator FloatTensor🔗
enumerator Float16Tensor🔗
enumerator DoubleTensor🔗
enumerator FComplexTensor🔗
enumerator DComplexTensor🔗
enum RoundingMode🔗

Rounding and clamping modes.

Rounding takes an effect only when the the input type is a floating point type and the output type is an integral type. Clamping takes an effect only when the output type is an integral type.

Values:

enumerator TruncateAndWrap🔗

Truncate the decimal part and cast the result to the output type without overflow or underflow checks.

enumerator RoundAndWrap🔗

Round the decimal part and and cast the result to the output type without overflow or underflow checks.

enumerator TruncateAndClamp🔗

Truncate the decimal part and clamp the result between minimum and maximum values of the output type to prevent spurious overflow and underflow.

enumerator RoundAndClamp🔗

Round the decimal part and clamp the result between minimum and maximum values of the output type to prevent spurious overflow and underflow.