Synchronously validate input operands/validations#605
Merged
fdwr merged 3 commits intowebmachinelearning:mainfrom Mar 20, 2024
inexorabletash:content-validate-input-operands
Merged
Synchronously validate input operands/validations#605fdwr merged 3 commits intowebmachinelearning:mainfrom inexorabletash:content-validate-input-operands
fdwr merged 3 commits intowebmachinelearning:mainfrom
inexorabletash:content-validate-input-operands
Conversation
Previously the spec had a "validate `MLOperand`" helper that (1) ensured the operand was from the passed `MLGraphBuilder` and (2) that the operand was internally consistent, and this was called during (3) `build()` and (4) only `concat()` among the vending methods. - (1) is needed but can be done when the `MLOperand` is created, giving better feedback, so (3) isn't needed. - (2) is not needed - `MLOperands` are immutable so they can't be created in a bad state. - (4) should be expanded to all `MLOperand` creations that take input `MLOperand`s. This renames the helper, ensures it is called by every `MLOperand` vending method that takes `MLOperand` inputs, and drops it from `build()` (although that will probably collide with PR #603 which should land first). Similar validation is added for `MLActivation`s. For #572
huningxin
approved these changes
Mar 19, 2024
Contributor
huningxin
left a comment
There was a problem hiding this comment.
LGTM with nits, thanks!
Missed a few "if it exists" clauses Co-authored-by: Ningxin Hu <[email protected]>
github-actions bot
added a commit
that referenced
this pull request
Mar 20, 2024
SHA: b04124c Reason: push, by fdwr Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously the spec had a "validate
MLOperand" helper that (1) ensured the operand was from the passedMLGraphBuilderand (2) that the operand was internally consistent, and this was called during (3)build()and (4) onlyconcat()among the vending methods.(1) is needed but can be done when the
MLOperandis created, giving better feedback, so (3) isn't needed.(2) is not needed -
MLOperandsare immutable so they can't be created in a bad state.(4) should be expanded to all
MLOperandcreations that take inputMLOperands.This renames the helper, ensures it is called by every
MLOperandvending method that takesMLOperandinputs, and drops it frombuild(). Similar validation is added forMLActivationinputs.For #572
Preview | Diff