code: def test_specialize_buffer_var_to_expr():
      """Handle specialization of buffer var
  
      The `tir::Buffer::data` field must be an explicit `tir::Var`, and
      cannot be replaced with a `tir::PrimExpr` of type
      `DataType::Handle()`.  However, these substitutions are useful
      when lowering.  If these occur, a binding of the `tir::Var` is
      included in the specialized function.
      """
  
      @T.prim_func(private=True)
      def before(
          A_data: T.handle("float32"), B_data: T.handle("float32")
      ):
          A_buf = T.decl_buffer(32, "float32", data=A_data)
          B_buf = T.decl_buffer(16, "float32", data=B_data)
          for i in range(16):
              B_buf[i] = A_buf[i] * 2.0
  
      @T.prim_func(private=True)
      def expected(A_data: T.handle("float32")):
          A_buf = T.decl_buffer(32, "float32", data=A_data)
          B_data: T.Ptr[T.float32] = T.address_of(A_buf[16])
          B_buf = T.decl_buffer(16, "float32", data=B_data)
          for i in range(16):
              B_buf[i] = A_buf[i] * 2.0
  
      B_data = before.params[1]
      A_buf = before.body.buffer
      param_map = {B_data: tvm.tir.address_of(A_buf[16])}
      after = before.specialize(param_map)
  
      tvm.ir.assert_structural_equal(expected, after)
  
imports: import tvm
  from tvm.script import tir
  from tvm.tir.schedule.testing import assert_structural_equal_ignore_global_symbol
label_desc: Use image node_id 19 for calling a global function with example usage: test_specialize_buffer_var_to_expr() without return types