Skip to content

Commit

Permalink
property for sigma int/float
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumehu committed Nov 13, 2023
1 parent ed6b607 commit b12f8fa
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion torchcfm/conditional_flow_matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,16 @@ def __init__(self, sigma: float = 0.0):
----------
sigma : float
"""
self.sigma = sigma
self._sigma = sigma

@property
def sigma(self):
if isinstance(self._sigma, float):
return self._sigma
elif isinstance(self._sigma, int):
return float(self._sigma)
else:
raise ValueError("Sigma must be a float or int.")

def compute_mu_t(self, x0, x1, t):
"""
Expand Down

0 comments on commit b12f8fa

Please sign in to comment.