code: def test_boolean_indexing_sum_not_applicable():
      """Test that boolean_indexing_sum does not return an invalid replacement in cases where it doesn't apply."""
      x = pt.matrix("x")
      out = x[x[:, 0] < 0, :].sum(axis=-1)
      fg = FunctionGraph([x], [out])
      assert (
          boolean_indexing_sum.transform(fg, fg.outputs[0].owner)
          is None
      )
  
      out = x[x[:, 0] < 0, 0].sum()
      fg = FunctionGraph([x], [out])
      assert (
          boolean_indexing_sum.transform(fg, fg.outputs[0].owner)
          is None
      )
  
file_path: pytensor/tests/link/jax/test_subtensor.py
imports: import numpy
  import pytest
  import pytensor.tensor
  from pytensor.configdefaults import config
  from pytensor.graph.fg import FunctionGraph
  from pytensor.tensor import subtensor
  from pytensor.tensor.rewriting.jax import boolean_indexing_set_or_inc, boolean_indexing_sum
  from tests.link.jax.test_basic import compare_jax_and_py
label_desc: Use image node_id 5 for calling a global function with example usage: test_boolean_indexing_sum_not_applicable() without return types