-
Notifications
You must be signed in to change notification settings - Fork 806
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
Conversation
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
codegen/utils.py
Outdated
chunk = tuple(itertools.islice(data_iterator, chunk_size)) | ||
while chunk: | ||
yield chunk | ||
chunk = tuple(itertools.islice(data_iterator, chunk_size)) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this 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.
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