code: def test_merge_with_weird_eq():
      # numpy arrays don't compare equal like other python objects
  
      # SCALAR CASE
      x = ptb.constant(np.asarray(1), name="x")
      y = ptb.constant(np.asarray(1), name="y")
      g = FunctionGraph([x, y], [x + y])
      MergeOptimizer().rewrite(g)
  
      assert len(g.apply_nodes) == 1
      node = list(g.apply_nodes)[0]
      assert len(node.inputs) == 2
      assert node.inputs[0] is node.inputs[1]
  
      # NONSCALAR CASE
      # This was created to test TensorConstantSignature
      x = ptb.constant(np.ones(5), name="x")
      y = ptb.constant(np.ones(5), name="y")
      g = FunctionGraph([x, y], [x + y])
      MergeOptimizer().rewrite(g)
  
      assert len(g.apply_nodes) == 1
      node = list(g.apply_nodes)[0]
      assert len(node.inputs) == 2
      assert node.inputs[0] is node.inputs[1]
  
imports: import numpy
  import pytensor.tensor.basic
  from pytensor.graph.basic import Apply, Variable
  from pytensor.graph.fg import FunctionGraph
  from pytensor.graph.op import Op
  from pytensor.graph.rewriting.basic import MergeOptimizer
  from pytensor.graph.type import Type
label_desc: Use image node_id 2 for calling a global function with example usage: test_merge_with_weird_eq() without return types