code: def is_not_finite(
      X: Tensor,
  ) -> Tensor:  # returns Tensor of dtype bool
      """Checks if tensor x is finite, if not throws an exception."""
      # x = tensorflow.check_numerics(x, "innvestigate - is_finite check")
      return tf.logical_not(tf.math.is_finite(X))
  
imports: from __future__ import annotations
  from typing import TypeVar
  import numpy
  import tensorflow
  import tensorflow.keras.backend
  from innvestigate.backend.types import Layer, OptionalList, ShapeTuple, Tensor
label_desc: Use image node_id 7 for calling a global function with example usage: is_not_finite(X) and returns: tf