Skip to content

Commit

Permalink
Check the context/funciton PK mappings. (#77)
Browse files Browse the repository at this point in the history
* Check the context/function PK mappings.

We need at least one if we are expecting at least one tensor parameter.
  • Loading branch information
khatchad authored Jan 23, 2024
1 parent 663d27b commit eb4f301
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,11 @@ private void testTf2(
.filter(LocalPointerKey::isParameter)
.collect(groupingBy(lpk -> lpk.getNode().getContext(), toSet()));

assertTrue(
"Because tensor parameters are inferred via function arguments, we need at least one"
+ " calling context if we are expecting at least one tensor parameter.",
expectedNumberOfTensorParameters <= 0 || contextToFunctionParameterPointerKeys.size() > 0);

for (Context ctx : contextToFunctionParameterPointerKeys.keySet()) {
// check tensor parameters.
Set<LocalPointerKey> functionParameterPointerKeys =
Expand Down

0 comments on commit eb4f301

Please sign in to comment.