code: def test_sparse_dot_constant_sparse(x_type, y_type, op):
      inputs = []
      test_values = []
  
      if x_type is ps.matrix:
          x_sp = scipy.sparse.random(
              5, 40, density=0.25, format="csr", dtype="float32"
          )
          x_pt = ps.as_sparse_variable(x_sp, name="x")
      else:
          x_pt = x_type("x", dtype="float32")
          if x_pt.ndim == 1:
              x_test = np.arange(40, dtype="float32")
          else:
              x_test = np.arange(5 * 40, dtype="float32").reshape(5, 40)
          inputs.append(x_pt)
          test_values.append(x_test)
  
      if y_type is ps.matrix:
          y_sp = scipy.sparse.random(
              40, 3, density=0.25, format="csc", dtype="float32"
          )
          y_pt = ps.as_sparse_variable(y_sp, name="y")
      else:
          y_pt = y_type("y", dtype="float32")
          if y_pt.ndim == 1:
              y_test = np.arange(40, dtype="float32")
          else:
              y_test = np.arange(40 * 3, dtype="float32").reshape(40, 3)
          inputs.append(y_pt)
          test_values.append(y_test)
  
      dot_pt = op(x_pt, y_pt)
      fgraph = FunctionGraph(inputs, [dot_pt])
      compare_jax_and_py(fgraph, test_values)
  
file_path: pytensor/tests/link/jax/test_sparse.py
imports: import numpy
  import pytest
  import scipy.sparse
  import pytensor.sparse
  import pytensor.tensor
  from pytensor import function
  from pytensor.graph import FunctionGraph
  from tests.link.jax.test_basic import compare_jax_and_py
label_desc: Use image node_id 1 for calling a global function with example usage: test_sparse_dot_constant_sparse(x_type, y_type, op) without return types