tensorflow / tensorflow/graphics

`knot_weights` function expects only a `int` (but not a `tensor`) as a parameter

Open
#707 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.8k
Forks
374
PR merge metrics
No merged PRs in 30d

Description

The knot_weights function, from:
tensorflow_graphics.math.interpolation.bspline
requires an int for the number of knots and the degree parameters (it is mentioned in the documentation), and if a tf.constant is passed, the unhashable tensor exception will occur.

Although it is not really a bug, this seems to be a design flaw, and not expected at all (especially that other parameters are expecting tensors), since it breaks graph generation with @tf.function, unless I will convert it explicitly to int, as pointed here: https://github.com/tensorflow/tensorflow/issues/27491#issuecomment-890887810

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at tensorflow_graphics.math.interpolation.bspline.knot_weights and reproduce the reported failure by passing tf.constant values, especially inside @tf.function. Determine the intended handling of tensor inputs and verify the chosen behavior with focused tests; done means graph generation no longer raises the unhashable-tensor exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, tensorflow
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.