MCPcopy Create free account
hub / github.com/thygate/stable-diffusion-webui-depthmap-script / torch_gc

Function torch_gc

src/backbone.py:103–109  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

101 image.save(fullfn, format=format)
102
103 def torch_gc():
104 # TODO: is this really sufficient?
105 import torch
106 if torch.cuda.is_available():
107 with torch.cuda.device('cuda'):
108 torch.cuda.empty_cache()
109 torch.cuda.ipc_collect()
110
111 launched_at = int(datetime.now().timestamp())
112 backbone_current_seq_number = 0

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected