2.0 KiB
IsFinite
@sphinxdirective
Versioned name: IsFinite-10
Category: Comparison
Short description: IsFinite performs element-wise test for finiteness (not Infinity and not NaN) on elements of a given input tensor. It returns the boolean mask of a given tensor which maps
NaN and Infinity to False and all other values to True
IsFinite operation has no attributes.
Detailed description: IsFinite returns the boolean mask of the input tensor in which False corresponds to NaN and Infinity and True to all other values.
- The output tensor has the same shape as the input tensor.
- The
i'th element of the output tensor isFalseifi'th element of the input tensor isNaNorInf. Otherwise, it isTrue. - For example, for a given input tensor
[NaN, 2.1, 3.7, Inf]the output tensor is[False, True, True, False].
Attributes
IsFinite operation has no attributes.
Inputs
- 1: A tensor of type T and arbitrary shape. Required.
Outputs
- 1: The result of element-wise IsFinite operation. A tensor of type
booleanand the same shape as input tensor.
Types
- T: any supported floating-point type.
Examples
.. code-block:: cpp
<layer ... type="IsFinite"> 256 56 256 56
.. code-block:: cpp
<layer ... type="IsFinite"> 4 < !-- Input value is: [NaN, 2.1, 3.7, Inf] --> 4 < !-- Output value is: [False, True, True, False] -->
@endsphinxdirective