Skip to content

Commit

Permalink
pep8
Browse files Browse the repository at this point in the history
  • Loading branch information
kilianFatras committed Nov 21, 2023
1 parent a040bb1 commit 328af66
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion torchcfm/optimal_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ def sample_map(self, pi, batch_size, replace=True):
"""
p = pi.flatten()
p = p / p.sum()
choices = np.random.choice(pi.shape[0] * pi.shape[1], p=p, size=batch_size, replace=replace)
choices = np.random.choice(
pi.shape[0] * pi.shape[1], p=p, size=batch_size, replace=replace
)
return np.divmod(choices, pi.shape[1])

def sample_plan(self, x0, x1, replace=True):
Expand Down

0 comments on commit 328af66

Please sign in to comment.