MCPcopy Create free account
hub / github.com/apache/tvm / test_buffer_flatten

Function test_buffer_flatten

tests/python/tirx-base/test_tir_buffer.py:181–186  ·  view source on GitHub ↗

A buffer should flatten to a 1-d shape

()

Source from the content-addressed store, hash-verified

179
180
181def test_buffer_flatten():
182 """A buffer should flatten to a 1-d shape"""
183 buf = tvm.tirx.decl_buffer([16, 32])
184 flat = buf.get_flattened_buffer()
185 assert buf.data.same_as(flat.data)
186 tvm.ir.assert_structural_equal(flat.shape, [T.int32(16 * 32)])
187
188
189def test_buffer_flatten_preserves_identity():

Callers

nothing calls this directly

Calls 2

get_flattened_bufferMethod · 0.80
same_asMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…