diff options
author | papuSpartan <30642826+papuSpartan@users.noreply.github.com> | 2022-12-10 00:02:39 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-10 00:02:39 -0800 |
commit | 6387043fd2c3311d66690ff27d7da0e030b29cd8 (patch) | |
tree | 075559ce3e52511cdd459da2b4cc33360d6eb258 /modules/sd_hijack_checkpoint.py | |
parent | 00ebc26c4e2962a31e067539d89cd695d999539a (diff) | |
parent | 1d01404c5615debfca24f7fbe429ddd2f5b11eb9 (diff) |
Merge branch 'AUTOMATIC1111:master' into master
Diffstat (limited to 'modules/sd_hijack_checkpoint.py')
-rw-r--r-- | modules/sd_hijack_checkpoint.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/sd_hijack_checkpoint.py b/modules/sd_hijack_checkpoint.py new file mode 100644 index 00000000..5712972f --- /dev/null +++ b/modules/sd_hijack_checkpoint.py @@ -0,0 +1,10 @@ +from torch.utils.checkpoint import checkpoint + +def BasicTransformerBlock_forward(self, x, context=None): + return checkpoint(self._forward, x, context) + +def AttentionBlock_forward(self, x): + return checkpoint(self._forward, x) + +def ResBlock_forward(self, x, emb): + return checkpoint(self._forward, x, emb)
\ No newline at end of file |