mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-02-28 14:40:27 +00:00
Remove some useless code.
This commit is contained in:
parent
b50ab153f9
commit
aff16532d4
@ -41,27 +41,12 @@ def exists(val):
|
|||||||
return val is not None
|
return val is not None
|
||||||
|
|
||||||
|
|
||||||
def uniq(arr):
|
|
||||||
return{el: True for el in arr}.keys()
|
|
||||||
|
|
||||||
|
|
||||||
def default(val, d):
|
def default(val, d):
|
||||||
if exists(val):
|
if exists(val):
|
||||||
return val
|
return val
|
||||||
return d
|
return d
|
||||||
|
|
||||||
|
|
||||||
def max_neg_value(t):
|
|
||||||
return -torch.finfo(t.dtype).max
|
|
||||||
|
|
||||||
|
|
||||||
def init_(tensor):
|
|
||||||
dim = tensor.shape[-1]
|
|
||||||
std = 1 / math.sqrt(dim)
|
|
||||||
tensor.uniform_(-std, std)
|
|
||||||
return tensor
|
|
||||||
|
|
||||||
|
|
||||||
# feedforward
|
# feedforward
|
||||||
class GEGLU(nn.Module):
|
class GEGLU(nn.Module):
|
||||||
def __init__(self, dim_in, dim_out, dtype=None, device=None, operations=ops):
|
def __init__(self, dim_in, dim_out, dtype=None, device=None, operations=ops):
|
||||||
|
Loading…
Reference in New Issue
Block a user