MCPcopy Index your code
hub / github.com/huggingface/datasets / assert_arrow_memory_doesnt_increase

Function assert_arrow_memory_doesnt_increase

tests/utils.py:530–536  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

528
529@contextmanager
530def assert_arrow_memory_doesnt_increase():
531 import gc
532
533 gc.collect()
534 previous_allocated_memory = pa.total_allocated_bytes()
535 yield
536 assert pa.total_allocated_bytes() - previous_allocated_memory <= 0, "Arrow memory wasn't expected to increase."
537
538
539def is_rng_equal(rng1, rng2):

Calls

no outgoing calls