Skip to content

Fix UnbalancedSinkhornTransport transform failing on nx.array_equal (closes #650) - #837

Open
JaySingh79 wants to merge 1 commit into
PythonOT:masterfrom
JaySingh79:fix-650-unbalanced-sinkhorn-nx
Open

Fix UnbalancedSinkhornTransport transform failing on nx.array_equal (closes #650)#837
JaySingh79 wants to merge 1 commit into
PythonOT:masterfrom
JaySingh79:fix-650-unbalanced-sinkhorn-nx

Conversation

@JaySingh79

Copy link
Copy Markdown

fit() now initializes the backend attribute nx before the check_params
gate, matching the behavior of BaseTransport.fit. Previously, a fit call
with missing parameters left self.nx as None, causing any subsequent
transform() call to crash with:
AttributeError: 'NoneType' object has no attribute 'array_equal'

Adds a non-regression test covering both incomplete fit and a separate
transform call.

Types of changes

Motivation and context / Related issue

How has this been tested (if it applies)

PR checklist

  • I have read the CONTRIBUTING document.
  • The documentation is up-to-date with the changes I made (check build artifacts).
  • All tests passed, and additional code has been covered with new tests.
  • I have added the PR and Issue fix to the RELEASES.md file.

…loses PythonOT#650)

fit() now initializes the backend attribute nx before the check_params
gate, matching the behavior of BaseTransport.fit. Previously, a fit call
with missing parameters left self.nx as None, causing any subsequent
transform() call to crash with:
AttributeError: 'NoneType' object has no attribute 'array_equal'

Adds a non-regression test covering both incomplete fit and a separate
transform call.
@github-actions github-actions Bot added the Tests label Aug 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant