• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ponder-lab / Hybridize-Functions-Refactoring / #2539
82%
main: 83%

Build:
Build:
LAST BUILD BRANCH: dependabot/github_actions/actions/setup-python-7
DEFAULT BRANCH: main
Ran 17 Jul 2026 11:14AM UTC
Jobs 1
Files 33
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

17 Jul 2026 11:10AM UTC coverage: 82.085% (+0.2%) from 81.87%
#2539

push

github

web-flow
Omit defaulted non-tensor parameters from an inferred input signature (#788)

* Omit defaulted non-tensor parameters from an inferred input signature

`computeInputSignature` treated every non-tensor parameter as fatal, which is
stricter than TensorFlow. A `TensorSpec` is required per *required* argument,
not per argument: on TF 2.9.3, `@tf.function(input_signature=[tf.TensorSpec(
shape=[2], dtype=tf.float32)])` over `def f(x, training=True)` is accepted and
returns, while the same signature over `def f(x, training)` raises `TypeError:
The decorated function f has 2 required argument(s), but tf.function was only
passed an input_signature of length 1`. TensorFlow's own message states the
rule. So a defaulted `training` was declining signatures TensorFlow would take.

Omitting the parameter is not unconditional, though, because it changes the
hybridized function's arity: the function then accepts exactly what the
signature names, and `f(tf.constant([1.0, 2.0]), False)` starts raising
`TypeError: f(x, training) specifies 1 positional arguments, but got 2`. Two
conditions gate it, and each gets its own reason so the two stay separable:

- `DEFAULTED_PARAMETER_SUPPLIED`: some call site passes the parameter, so
  omitting it would break that caller. Also covers ignorance (no call-graph
  node, unresolvable predecessor, non-Python invoke), since absent evidence
  must not read as evidence of absence.
- `DEFAULTED_PARAMETER_PRECEDES_SPEC`: nobody passes it, but a later parameter
  contributes a spec. An input signature covers parameters positionally, so
  omitting this one would apply the later spec to it. Python's grammar forces
  defaults to trail the required parameters but still permits a defaulted
  tensor parameter after a defaulted non-tensor one, which is the
  `def call(self, x, training=False, mask=None)` Keras shape.

`NON_TENSOR_PARAMETER` narrows to the required case, which is genuinely
unsatisfiable.

The supply check is the first analysis here ... (continued)

75 of 83 new or added lines in 4 files covered. (90.36%)

2213 of 2696 relevant lines covered (82.08%)

0.82 hits per line

Uncovered Changes

Lines Coverage ∆ File
6
93.64
-0.07% edu.cuny.hunter.hybridize.core/src/edu/cuny/hunter/hybridize/core/analysis/Function.java
2
70.0
-0.28% edu.cuny.hunter.hybridize.core/src/edu/cuny/hunter/hybridize/core/refactorings/HybridizeFunctionRefactoringProcessor.java
Jobs
ID Job ID Ran Files Coverage
1 #2539.1 17 Jul 2026 11:14AM UTC 33
82.08
Source Files on build #2539
  • Tree
  • List 33
  • Changed 4
  • Source Changed 4
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 643f0493 on github
  • Prev Build on gh-readonly-queue/main/pr-785-952f34c63a0db25adbb178e1c6e09eca09b2ebac
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc