Skip to content

Add chain optimizations for Conditional nodes#2895

Merged
joeyballentine merged 1 commit intochaiNNer-org:mainfrom
RunDevelopment:optimize-cond
May 21, 2024
Merged

Add chain optimizations for Conditional nodes#2895
joeyballentine merged 1 commit intochaiNNer-org:mainfrom
RunDevelopment:optimize-cond

Conversation

@RunDevelopment
Copy link
Member

The new optimization removes a Conditional node if:

  1. its condition is a statically known constant, or
  2. both the If True and If False inputs are connected to the same node.

Constant conditions aren't used right now, but they will be once the Condition inputs gets an input element in the UI.


I also changed the switch optimization to remove the Switch node instead of trimming other inputs. I did this, because it's a prerequisite for other optimizations.

@joeyballentine joeyballentine merged commit d5cfda0 into chaiNNer-org:main May 21, 2024
@RunDevelopment RunDevelopment deleted the optimize-cond branch May 21, 2024 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants