Skip to content

Commit

Permalink
Synchronously validate input operands/validations
Browse files Browse the repository at this point in the history
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 webmachinelearning#603 which
should land first). Similar validation is added for `MLActivation`s.

For webmachinelearning#572
  • Loading branch information
inexorabletash committed Mar 16, 2024
1 parent 048e855 commit 81a986c
Showing 1 changed file with 54 additions and 11 deletions.
Loading

0 comments on commit 81a986c

Please sign in to comment.