Skip to content

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

Open
@khatchad

Description

@khatchad

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions