You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am seeing in the logs multiple SSA variables corresponding to a single Python variable being added as tensor dataset sources. This might be okay; dataset sources aren't really the same as tensor sources not stemming from datasets. In other words, the dataset holds the tensors, whereas in the non-dataset case, the tensors are generated from some API (e.g., tf.ones()).
But, I'm unsure. It makes the test values look weird (where are there so many tensor variables in a function?). It may also cause confused when we start tracking shape/d-types for TF2 APIs. I don't think it would hurt just to have the final SSA variable be marked as a tensor dataset source (though one could question how we are representing dataset sources, particularly when it comes tracking shapes; should they be separate?).
One could also ask why, in the SSA, are multiple variables representing the same Python variable.
Example
This is what I am seeing:
# Test enumerate. The first element of the tuple returned isn't a tensor.importtensorflowastfdeff(a):
passdefg(a):
passdataset=tf.data.Dataset.from_tensor_slices([1, 2, 3])
forstep, elementinenumerate(dataset, 1):
f(step)
g(element)
That's the input. In the logs, there are two SSA variables representing element, namely, v278 and v282:
[INFO] Added dataflow source from tensor dataset: [Node: <Code body of function Lscript tf2_test_dataset11.py> Context: CallStringContext: [ com.ibm.wala.FakeRootClass.fakeRootMethod()V@2 ], v278]:[Empty].
[INFO] Added dataflow source from tensor dataset: [Node: <Code body of function Lscript tf2_test_dataset11.py> Context: CallStringContext: [ com.ibm.wala.FakeRootClass.fakeRootMethod()V@2 ], v282]:[Empty].
We really only need the second one, I think, unless there is some particular reason there are multiple SSA variables representing the same Python variable. But, since v278 is never referenced again, so I would say not.
The text was updated successfully, but these errors were encountered:
I think this is happening because we are (interprocedurally) processing two different types of SSA instructions, those corresponding to for each statements and field reads:
[FINE] Processing instruction: 274 = a property name of 265.
[INFO] Using interprocedural analysis to find potential tensor iterable definition for use: 265 of instruction: 274 = a property name of 265.
[INFO] Added dataflow source from tensor dataset: [Node: <Code body of function Lscript tf2_test_dataset11.py> Context: CallStringContext: [ com.ibm.wala.FakeRootClass.fakeRootMethod()V@2 ], v278]:[Empty].
...
[FINE] Processing instruction: 279 = fieldref 265.280.
[INFO] Using interprocedural analysis to find potential tensor iterable definition for use: 265 of instruction: 279 = fieldref 265.280.
[INFO] Added dataflow source from tensor dataset: [Node: <Code body of function Lscript tf2_test_dataset11.py> Context: CallStringContext: [ com.ibm.wala.FakeRootClass.fakeRootMethod()V@2 ], v282]:[Empty].
I believe we did this to make the analysis more robust to different situations, i.e., there is some other situation where we are reading tensors from datasets but only one of these instruction pops up. But, since dataset reads aren't considered "tensor generators," this might be OK. But, we do add tensor data sources the same way in both cases. I'm unsure of whether they need to be distinguished, but right now at least they aren't seemingly causing a problem.
I am seeing in the logs multiple SSA variables corresponding to a single Python variable being added as tensor dataset sources. This might be okay; dataset sources aren't really the same as tensor sources not stemming from datasets. In other words, the dataset holds the tensors, whereas in the non-dataset case, the tensors are generated from some API (e.g.,
tf.ones()
).But, I'm unsure. It makes the test values look weird (where are there so many tensor variables in a function?). It may also cause confused when we start tracking shape/d-types for TF2 APIs. I don't think it would hurt just to have the final SSA variable be marked as a tensor dataset source (though one could question how we are representing dataset sources, particularly when it comes tracking shapes; should they be separate?).
One could also ask why, in the SSA, are multiple variables representing the same Python variable.
Example
This is what I am seeing:
That's the input. In the logs, there are two SSA variables representing
element
, namely,v278
andv282
:Producing the following corresponding logs:
We really only need the second one, I think, unless there is some particular reason there are multiple SSA variables representing the same Python variable. But, since
v278
is never referenced again, so I would say not.The text was updated successfully, but these errors were encountered: