MCPcopy Create free account
hub / github.com/modelscope/modelscope / cleanup

Function cleanup

modelscope/models/cv/nerf_recon_4k/network/utils.py:167–178  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

165
166
167def cleanup():
168 try:
169 import tinycudann as tcnn
170 except ImportError as e:
171 raise ImportError(
172 'Cannot import tinycudann, please install by '
173 '`pip install git+https://github.com/NVlabs/tiny-cuda-nn/'
174 '#subdirectory=bindings/torc`') from e
175
176 gc.collect()
177 torch.cuda.empty_cache()
178 tcnn.free_temporary_memory()
179
180
181def update_module_step(m, epoch, global_step):

Callers 1

tearDownMethod · 0.50

Calls

no outgoing calls

Tested by 1

tearDownMethod · 0.40

Used in the wild real call sites across dependent graphs

searching dependent graphs…