Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
lshqqytiger committed Feb 20, 2023
1 parent 6c6014f commit c888249
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions modules/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,6 @@
if devices.adl is None or devices.hMEM is None or (cmd_opts.device_id is not None and cmd_opts.device_id != "0"):
print("Disabled experimental graphic memory optimizations.")
cmd_opts.disable_experimental_memopt = True
if not cmd_opts.no_half:
import torch
torch.cat = devices.cat

torch.nn.GroupNorm = devices.GroupNorm
torch.nn.LayerNorm = devices.LayerNorm
torch.nn.Linear = devices.Linear
torch.nn.Conv2d = devices.Conv2d
torch.nn.functional.pad = devices.pad


devices.device, devices.device_interrogate, devices.device_gfpgan, devices.device_esrgan, devices.device_codeformer = \
Expand All @@ -174,6 +165,17 @@
loaded_hypernetworks = []


if not cmd_opts.no_half and device.type == 'privateuseone':
import torch
torch.cat = devices.cat

torch.nn.GroupNorm = devices.GroupNorm
torch.nn.LayerNorm = devices.LayerNorm
torch.nn.Linear = devices.Linear
torch.nn.Conv2d = devices.Conv2d
torch.nn.functional.pad = devices.pad


def reload_hypernetworks():
from modules.hypernetworks import hypernetwork
global hypernetworks
Expand Down

0 comments on commit c888249

Please sign in to comment.