Skip to content

Commit d60cc24

Browse files
committed
able to set auto norm functions to identity with none
1 parent 9357710 commit d60cc24

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

rectified_flow_pytorch/rectified_flow.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ def exists(v):
2424
def default(v, d):
2525
return v if exists(v) else d
2626

27+
def identity(t):
28+
return t
29+
2730
# tensor helpers
2831

2932
def append_dims(t, ndims):
@@ -147,8 +150,8 @@ def __init__(
147150

148151
# normalizing fn
149152

150-
self.data_normalize_fn = data_normalize_fn
151-
self.data_unnormalize_fn = data_unnormalize_fn
153+
self.data_normalize_fn = default(data_normalize_fn, identity)
154+
self.data_unnormalize_fn = default(data_unnormalize_fn, identity)
152155

153156
@property
154157
def device(self):

0 commit comments

Comments
 (0)