Remove some useless code.

This commit is contained in:
comfyanonymous 2025-02-22 04:45:14 -05:00
parent b50ab153f9
commit aff16532d4

View File

@ -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):