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

Tensor documentation hints at differences in graph and eager mode without providing details #49493

Open
lonerzzz opened this issue May 22, 2021 · 2 comments
Assignees
Labels
comp:apis Highlevel API related issues stat:awaiting tensorflower Status - Awaiting response from tensorflower type:docs-feature Doc issues for new feature, or clarifications about functionality

Comments

@lonerzzz
Copy link

lonerzzz commented May 22, 2021

URL(s) with the issue:

https://www.tensorflow.org/api_docs/python/tf/Tensor

Description of issue (what needs changing):

Currently, the description of what a tensor is is cutoff: "A tensor is a multidimensional array of elements represented by a"

Additionally, there is a comment about

"Note that during eager execution, you may discover your Tensors are actually of type EagerTensor. This is an internal detail, but it does give you access to a useful function, numpy:"

This implies that numpy is not available in graph mode. What else isn't available in graph mode? The documentation should describe the differences in capabilities between the two modes - probably on its own page if required.

In my case, I found this out when trying to create a custom loss function, only to find that a number of expected capabilities were not available on the tensor object. It took a long time to find this one line description that hints at the differences. Even then, however, I have no idea what I can use in that mode or where to set the mode so that I can access the data of the tensor.

@UsharaniPagadala UsharaniPagadala added comp:apis Highlevel API related issues type:docs-feature Doc issues for new feature, or clarifications about functionality labels May 24, 2021
@rmothukuru
Copy link
Contributor

@lonerzzz,
The differences might not be specified in the documentation of tf.tensor. Please refer the detailed documentation related to Eager Execution and the Graph Execution to understand the complete functionalities and the differences between them. Hope this helps. Thanks!

@rmothukuru rmothukuru added the stat:awaiting response Status - Awaiting response from author label May 25, 2021
@lonerzzz
Copy link
Author

lonerzzz commented May 30, 2021

Thanks for the reference but the Eager Execution page is still vague in too many ways and does not cover tensors in sufficient detail. For example, this sentence "tf.Variable objects store mutable tf.Tensor-like values accessed during training to make automatic differentiation easier." exists without indicating any detail on the implications of this.

However, I can see serious implications. For example, when I attempt to access a number of tensor functions that would be present on a tensor in a custom loss function, none of them are available. Hence, either the tensor documentation or eager execution documentation needs to be expanded to cover this.

The mapping from tf.Variable to tf.Tensor and how to access the real tensor capability would be a key point to describe.

@rmothukuru rmothukuru assigned MarkDaoust and unassigned rmothukuru Jun 4, 2021
@rmothukuru rmothukuru added stat:awaiting tensorflower Status - Awaiting response from tensorflower and removed stat:awaiting response Status - Awaiting response from author labels Jun 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:apis Highlevel API related issues stat:awaiting tensorflower Status - Awaiting response from tensorflower type:docs-feature Doc issues for new feature, or clarifications about functionality
Projects
None yet
Development

No branches or pull requests

4 participants