tensorflow / tensorflow/graphics

Performance issue in the definition of render_splat, tensorflow_graphics/rendering/tests/splat_test.py

Open
#642 1 comment 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

Hello, I found a performance issue in the definition of render_splat, tensorflow_graphics/rendering/tests/splat_test.py, tf.reduce_mean in line 160 and 162 will be calculated repeatedly during program execution. I think it should be created before the loop in render_splat.

The same issue exist in tf.gather.

Looking forward to your reply. Btw, I am very glad to create a PR to fix it if you are too busy.

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 in tensorflow_graphics/rendering/tests/splat_test.py at render_splat, especially the tf.reduce_mean calls around lines 160 and 162, then inspect tensorflow_graphics/projects/points_to_3Dobjects/utils/evaluator.py around line 601 for the tf.gather call. Confirm the repeated operations can be created outside the loop, then run the relevant splat test and verify the evaluator behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, tensorflow
Domain
computer-graphics, performance
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.