IsNaN#

IsNaN - 13#

Version

  • name: IsNaN (GitHub)

  • domain: main

  • since_version: 13

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 13.

Summary

Returns which elements of the input are NaN.

Inputs

  • X (heterogeneous) - T1: input

Outputs

  • Y (heterogeneous) - T2: output

Type Constraints

  • T1 in ( tensor(bfloat16), tensor(double), tensor(float), tensor(float16) ): Constrain input types to float tensors.

  • T2 in ( tensor(bool) ): Constrain output types to boolean tensors.

Examples

default

import numpy as np
import onnx

node = onnx.helper.make_node(
    "IsNaN",
    inputs=["x"],
    outputs=["y"],
)

x = np.array([3.0, np.nan, 4.0, np.nan], dtype=np.float32)
y = np.isnan(x)
expect(node, inputs=[x], outputs=[y], name="test_isnan")

IsNaN - 9#

Version

  • name: IsNaN (GitHub)

  • domain: main

  • since_version: 9

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 9.

Summary

Returns which elements of the input are NaN.

Inputs

  • X (heterogeneous) - T1: input

Outputs

  • Y (heterogeneous) - T2: output

Type Constraints

  • T1 in ( tensor(double), tensor(float), tensor(float16) ): Constrain input types to float tensors.

  • T2 in ( tensor(bool) ): Constrain output types to boolean tensors.