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 conversions and tensor generators #139

Open
khatchad opened this issue Feb 1, 2024 · 0 comments
Open

Tensor conversions and tensor generators #139

khatchad opened this issue Feb 1, 2024 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers summaries

Comments

@khatchad
Copy link
Collaborator

khatchad commented Feb 1, 2024

There are situations where a TF API, e.g., tf.nn.relu(), can "generate" a tensor and have one just "pass through." In the summary representation, there isn't a way to express this, and it's dependent on the type of argument passed to the API.

Consider the following example based on the one at https://www.tensorflow.org/versions/r2.9/api_docs/python/tf/nn/relu:

import tensorflow as tf
from tensorflow.python.framework.ops import EagerTensor

a = [-2., 0., 3.]
assert(type(a) == list)

b = tf.nn.relu(a)
assert(type(b) == EagerTensor)

In this case, the API is seemingly converting the given list to a tensor. Such API are typically represented as tensor generators in Ariadne (i.e., the call the sentinel read_data()). But, in another example with the same API, it can accept a tensor without conversion:

import tensorflow as tf
from tensorflow.python.framework.ops import EagerTensor

a = tf.constant([-2., 0., 3.])
assert(type(a) == EagerTensor)

b = tf.nn.relu(a)
assert(type(b) == EagerTensor)

In this case, the API is a "pass through" API; it doesn't create a new tensor but rather modifies an existing one.

My feeling is that such API can't be solely represented in the summaries. I believe that there are other API like this, e.g., reshape().

@khatchad khatchad added bug Something isn't working summaries good first issue Good for newcomers labels Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers summaries
Projects
None yet
Development

No branches or pull requests

1 participant