code: def test_prim_func():
      x = te.var("x")
      y = te.var("y")
      # counter example of same equality
      func0 = tvm.tir.PrimFunc([x, y], tvm.tir.Evaluate(x + y))
      func1 = tvm.tir.PrimFunc([x, y], tvm.tir.Evaluate(y + x))
      assert not consistent_equal(func0, func1)
  
      # new cases
      b = tvm.tir.decl_buffer((x,), "float32")
      stmt = tvm.tir.LetStmt(x, 10, tvm.tir.Evaluate(x + 1))
      func0 = tvm.tir.PrimFunc([x, y, b], stmt)
      # easiest way to deep copy is via save/load
      func1 = tvm.ir.load_json(tvm.ir.save_json(func0))
      tvm.ir.assert_structural_equal(func0, func1)
  
      data0 = tvm.nd.array([1, 2, 3])
      data1 = tvm.nd.array([1, 2, 3])
      # attributes and ndarrays
      func0 = func0.with_attr("data", data0)
      func1 = func1.with_attr("data", data1)
      # IRModules
      mod0 = tvm.IRModule.from_expr(func0)
      mod1 = tvm.IRModule.from_expr(func1)
      tvm.ir.assert_structural_equal(mod0, mod1)
  
imports: import tvm
  import numpy
  import pytest
  from tvm import te
  from tvm.runtime import ObjectPath
  from tvm.script import tir, ir
label_desc: Use image node_id 4 for calling a global function with example usage: test_prim_func() without return types