-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[TF] Moved most Tensor APIs to 'tensorflow/swift-apis'. #24161
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
Conversation
Since we are preparing v0.3, we'll get to this next week! |
Sounds good! I'll keep making changes to this PR and the swift-apis one until then, if that's ok. |
Sure thing. |
Could you resolve the conflicts? |
@rxwei The conflicts should be resolved now. |
@swift-ci please clean test tensorflow Linux |
1 similar comment
@swift-ci please clean test tensorflow Linux |
I can try to look into later today but it may take a while because I need to recompile S4TF on one of our GPU servers. Also, I noticed from the tests that they only fail when we assign to a tensor, not when we're simply indexing. I'll try to figure out why. |
@rxwei also, I'm not sure if you're aware of this, but when I try to use |
Yeah, this is a known bug. |
Why can't we just export these symbols when compiling |
It's a linker flag issue. Symbols should already be exported module-wise. |
Where would be a good place to look into for fixing that? |
…ork currently from outside stdlib.
I think that @dan-zheng knows this best! |
Could you please share a reproducer? Here's some quick experimentation: // tfop.swift
import TensorFlow
let x = Tensor<Float>(1)
let tensor: Tensor<Float> =
#tfop("Identity", x, T$dtype: Float.tensorFlowDataType,
__shapes: [x.shape])
print(tensor) $ swift tfop.swift
1.0
$ swiftc tfop.swift
Undefined symbols for architecture x86_64:
"_TFE_DeleteOp", referenced from:
_$s10TensorFlow0A0V4tfopE10toHostTest5shapeACyxGAA0A5ShapeV_tF in tfop-5805d4.o
"_TFE_NewOp", referenced from:
_$s10TensorFlow0A0V4tfopE10toHostTest5shapeACyxGAA0A5ShapeV_tF in tfop-5805d4.o
"_TFE_OpSetAttrType", referenced from:
_$s10TensorFlow0A0V4tfopE10toHostTest5shapeACyxGAA0A5ShapeV_tF in tfop-5805d4.o
"_TF_DeleteStatus", referenced from:
_$s10TensorFlow0A0V4tfopE10toHostTest5shapeACyxGAA0A5ShapeV_tF in tfop-5805d4.o
"_TF_NewStatus", referenced from:
_$s10TensorFlow0A0V4tfopE10toHostTest5shapeACyxGAA0A5ShapeV_tF in tfop-5805d4.o
ld: symbol(s) not found for architecture x86_64
<unknown>:0: error: link command failed with exit code 1 (use -v to see invocation)
$ swiftc -ltensorflow tfop.swift # succeeds
$ ./tfop
1.0 |
Thanks @dan-zheng ! I actually wasn't using |
I'm closing this in favor of a new PR I'm about to open. |
This PR is moving stuff over from stdlib to swift-apis and switching to using
eager
mode raw op bindings.I have also incorporated the following updates to tensorflow/swift-apis#109:
Friend PRs: tensorflow/swift-apis#109 and tensorflow/swift-bindings#26 .