Order of Code Input/Execution: ProtocolConformance & TFDifferentiation #88
Comments
Thanks a lot for the detailed report! import TensorFlow
@differentiable(reverse)
func quadratic(_ x: Float) -> Float {
return x * x
} |
No problem @rxwei ! For error 1, should I file a bug here regarding it so we can investigate it further at a later date since it isn't a major bug, or file it somewhere else? Unsure as it's related to the LLDB Debugger, but also this seems TensorFlow specific. Regarding error 2, thanks for the explanation that makes sense to me now! Especially after going through the Swift TensorFlow tutorial, it has made things clearer; specifically this limitation even seems sort of similar to the Swift Dataset API as described in the tutorial in that you need to make the dataset initialization function inlinable, copy the function to every Jupyter cell you use it, etc. |
If you can file a JIRA bug for error 1, that would be helpful! For error 2 we have a related bug: SR-8613, and have a planned fix next year. |
Filed the JIRA bug! Feel free to close this issue once you see this message. |
Thanks! |
There are two separate but sorted related issues I'm experiencing in both Swift REPL and swift-jupyter and I'll describe both issues here.
System info:
Error 1:
ProtocolConformance.cpp
Tensor Protocol Assertion Failed.How to Reproduce
This should also happen if you were to type this manually and not copy and paste the code into the console. The should comes with a caveat:
Expected Behavior
What should occur is the code should not error out and get the following in blue in the console:
Interestingly, this is possible! However, this is only possible if you paste in all of the code above as one chunk:
And in the console you get the following as expected:
Also, note that you can reproduce the same error in swift-jupyter but you need to treat each code block as separate code cells. If you stick all the code into one code cell, it will work as expected. The only different with swift-jupyter is that you get a generic error in the web-view and only the first/top line of the stack trace in the console where Jupyter is running.
Error 2:
TFDifferentiation.cpp
Function Body Assertion Failed.How to Reproduce
This happens also if you were to type this manually and not copy and paste the code into the console.
Expected Behavior
What should occur is the code should not error out and you should see something that looks like the following in blue in the console:
Just like the first error, this won't error if you past the code into the console as one chunk like this:
And in the console you get the following as expected:
Also, same thing regarding swift-jupyter experiencing a crash just like in the first error above applies here too.
Summary
Both errors seem related in that the error occurs due to the order of execution (maybe not order, but what Swift REPL sees in a specific instance when it reads and evaluates). However, as seen in the stack trace, they have to do with two different parts of Swift: already existing file
ProtocolConformance.cpp
and the new fileTFDifferentiation.cpp
that's a part of the Swift for TensorFlow project.The text was updated successfully, but these errors were encountered: