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

tf.Tensor used as a type is coming up as a tensor instance #172

Open
khatchad opened this issue Mar 21, 2024 · 0 comments
Open

tf.Tensor used as a type is coming up as a tensor instance #172

khatchad opened this issue Mar 21, 2024 · 0 comments
Labels
bug Something isn't working summaries

Comments

@khatchad
Copy link
Collaborator

Consider the following code:

from tensorflow import Tensor


def f(a):
    assert isinstance(a, Tensor)

I am seeing this in the tensor analysis:

[Node: synthetic < PythonLoader, Lwala/builtin/isinstance, do()LRoot; > Context: CallStringContext: [ script src.tf2_test_module3a.py.f.do()LRoot;@2 ], v2][{[D:Symbolic,n, D:Compound,[D:Constant,28, D:Constant,28]] of pixel}]

Here is the corresponding summary:

  • <new def="Tensor" class="Ltensorflow/functions/Tensor" />
    <putfield class="LRoot" field="Tensor" fieldType="LRoot" ref="x" value="Tensor" />
    <putfield class="LRoot" field="Tensor" fieldType="LRoot" ref="ops" value="Tensor" />
  • <class name="Tensor" allocatable="true">
    <method name="read_data" descriptor="()LRoot;">
    <new def="x" class="Ltensorflow/python/framework/ops/Tensor" />
    <return value="x" />
    </method>
    <method name="do" descriptor="()LRoot;" numArgs="3" paramNames="op value_index dtype">
    <call class="LRoot" name="read_data" descriptor="()LRoot;" type="virtual" arg0="arg0" def="x" />
    <return value="x" />
    </method>
    </class>

That looks right. I'm unsure why it's being picked up as function, though.

@khatchad khatchad added bug Something isn't working summaries labels Mar 21, 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 summaries
Projects
None yet
Development

No branches or pull requests

1 participant