tvm_tirx.support.utils.TempDirectory#

class tvm_tirx.support.utils.TempDirectory(custom_path=None, keep_for_debug=None)#

Bases: object

Helper object to manage temp directory during testing.

Automatically removes the directory when it went out of scope.

TEMPDIRS: ClassVar[set[str]] = {}#
classmethod remove_tempdirs()#
classmethod set_keep_for_debug(set_to=True)#

Keep temporary directories past program exit for debugging.

remove()#

Remove the tmp dir

property path#
relpath(name)#

Relative path in temp dir

Parameters:

name (str) – The name of the file.

Returns:

path (str) – The concatenated path.

listdir()#

List contents in the dir.

Returns:

names (list) – The content of directory