mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2025-01-07 03:17:05 +08:00
Raise in CustomEmbedding and CustomGroupNorm if a patch is applied.
This commit is contained in:
parent
918f541af8
commit
20acfc9a00
@ -20,6 +20,9 @@ class CustomEmbedding(torch.nn.Embedding, CustomModuleMixin):
|
||||
)
|
||||
|
||||
def forward(self, input: torch.Tensor) -> torch.Tensor:
|
||||
if len(self._patches_and_weights) > 0:
|
||||
raise RuntimeError("Embedding layers do not support patches")
|
||||
|
||||
if self._device_autocasting_enabled:
|
||||
return self._autocast_forward(input)
|
||||
else:
|
||||
|
@ -13,6 +13,9 @@ class CustomGroupNorm(torch.nn.GroupNorm, CustomModuleMixin):
|
||||
return torch.nn.functional.group_norm(input, self.num_groups, weight, bias, self.eps)
|
||||
|
||||
def forward(self, input: torch.Tensor) -> torch.Tensor:
|
||||
if len(self._patches_and_weights) > 0:
|
||||
raise RuntimeError("GroupNorm layers do not support patches")
|
||||
|
||||
if self._device_autocasting_enabled:
|
||||
return self._autocast_forward(input)
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user