code: def test_buffer_access_ptr_extent():
      m = te.size_var("m")
      n = te.size_var("n")
      Ab = tvm.tir.decl_buffer((m, n), "float32")
      aptr = Ab.access_ptr("rw")
      assert tvm.ir.structural_equal(aptr.args[3], m * n)
      aptr = Ab.access_ptr("rw", offset=100)
      assert tvm.ir.structural_equal(aptr.args[3], m * n - 100)
      Ab = tvm.tir.decl_buffer((m, n), "float32", strides=[n + 1, 1])
      aptr = Ab.access_ptr("rw", offset=100)
      assert tvm.ir.structural_equal(
          aptr.args[3], Ab.strides[0] * m - 100
      )
  
      # Test extent from input params
      aptr = Ab.access_ptr("rw", extent=200)
      assert tvm.ir.structural_equal(aptr.args[3], 200)
      aptr = Ab.access_ptr("rw", offset=100, extent=100)
      assert tvm.ir.structural_equal(aptr.args[3], 100)
  
file_path: tvm/tests/python/tir-base/test_tir_buffer.py
imports: import pytest
  import tvm
  import tvm.testing
  from tvm import te
  from tvm.tir import Buffer
  import numpy
label_desc: Use image node_id 4 for calling a global function with example usage: test_buffer_access_ptr_extent() without return types