MCPcopy
hub / github.com/huggingface/datasets / assert_arrow_memory_increases

Function assert_arrow_memory_increases

tests/utils.py:520–526  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

518
519@contextmanager
520def assert_arrow_memory_increases():
521 import gc
522
523 gc.collect()
524 previous_allocated_memory = pa.total_allocated_bytes()
525 yield
526 assert pa.total_allocated_bytes() - previous_allocated_memory > 0, "Arrow memory didn't increase."
527
528
529@contextmanager

Calls

no outgoing calls