Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate static TfLiteEvalTensors #2193

Merged
merged 2 commits into from
Aug 29, 2023
Merged

Conversation

rascani
Copy link
Collaborator

@rascani rascani commented Aug 28, 2023

This PR generates all of the TfLiteEvalTensors for the graph. It also generates all of the static buffers used for tensors that were present in the flatbuffer.

BUG=b/295077140

This PR generates all of the TfLiteEvalTensors for the graph. It also
generates all of the static buffers used for tensors that were present
in the flatbuffer.

BUG=b/295077140
@rascani rascani requested a review from a team as a code owner August 28, 2023 19:56
@rascani rascani added the ci:run label Aug 28, 2023
@TFLM-bot TFLM-bot removed the ci:run label Aug 28, 2023
@rascani rascani added the ci:run label Aug 28, 2023
@TFLM-bot TFLM-bot removed the ci:run label Aug 28, 2023
codegen/utils.py Outdated
Comment on lines 39 to 42
chunk = tuple(itertools.islice(data_iterator, chunk_size))
while chunk:
yield chunk
chunk = tuple(itertools.islice(data_iterator, chunk_size))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this reads a bit funny.

Is there any way to write this where the loop looks something like:

while <not sure what the condition would be>:
    chunk = tuple(itertools.islice(data_iterator, chunk_size))
    yield chunk

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WDYT of this:

while True:
  chunk = tuple(itertools.islice(data_iterator, chunk_size))
  if not chunk:
    break
  yield chunk

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1. that seems more readable to me.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Member

@advaitjain advaitjain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one nit question. Other than that lgtm.

@rascani rascani added the ci:run label Aug 28, 2023
@TFLM-bot TFLM-bot removed the ci:run label Aug 28, 2023
@rascani rascani added the ci:run label Aug 29, 2023
@TFLM-bot TFLM-bot removed the ci:run label Aug 29, 2023
@mergify mergify bot merged commit 4d07bd0 into tensorflow:main Aug 29, 2023
80 of 97 checks passed
@github-actions github-actions bot mentioned this pull request Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants