code: def test_filter_float_subclass():
      """Make sure `TensorType.filter` can handle `float` subclasses."""
      with config.change_flags(floatX="float64"):
          test_type = TensorType("float64", shape=())
  
          nan = np.array([np.nan], dtype="float64")[0]
          assert isinstance(nan, float) and not isinstance(
              nan, np.ndarray
          )
  
          filtered_nan = test_type.filter(nan)
          assert isinstance(filtered_nan, np.ndarray)
  
      with config.change_flags(floatX="float32"):
          # Try again, except this time `nan` isn't a `float`
          test_type = TensorType("float32", shape=())
  
          nan = np.array([np.nan], dtype="float32")[0]
          assert isinstance(nan, np.floating) and not isinstance(
              nan, np.ndarray
          )
  
          filtered_nan = test_type.filter(nan)
          assert isinstance(filtered_nan, np.ndarray)
  
imports: import os.path
  from tempfile import mkdtemp
  import numpy
  import pytest
  import pytensor.tensor
  from pytensor.configdefaults import config
  from pytensor.tensor.shape import SpecifyShape
  from pytensor.tensor.type import TensorType, col, matrix, row, scalar, tensor, tensor3, tensor4, tensor5, tensor6, tensor7, vector
label_desc: Use image node_id 9 for calling a global function with example usage: test_filter_float_subclass() without return types