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] Add bullet operator (•) for matrix multiplication #17173
Conversation
@swift-ci please test tensorflow |
@swift-ci please clean test tensorflow |
@swift-ci please test tensorflow |
@swift-ci PLEASE TEST TENSORFLOW |
@swift-ci please test tensorflow |
@swift-ci Please test tensorflow |
1 similar comment
@swift-ci Please test tensorflow |
@swift-ci please clean test tensorflow |
@shahmishal We couldn't trigger CI because it's stuck (https://ci-external.swift.org/job/swift-PR-TensorFlow-Linux/92/console). Is there a way to kill it? |
@swift-ci please clean test tensorflow |
@swift-ci test tensorflow |
@rxwei If you request testing again, it will abort the previous build. |
@swift-ci please clean test tensorflow |
@swift-ci please test tensorflow |
1 similar comment
@swift-ci please test tensorflow |
@swift-ci please clean test tensorflow |
1 similar comment
@swift-ci please clean test tensorflow |
@swift-ci please test tensorflow |
@swift-ci please test tensorflow |
1 similar comment
@swift-ci please test tensorflow |
@swift-ci please clean test tensorflow |
Nice, thanks! |
Add `•` operator for matmul, and remove `Tensor.dot` and `⊗` completely.
Add `•` operator for matmul, and remove `Tensor.dot` and `⊗` completely.
Add `•` operator for matmul, and remove `Tensor.dot` and `⊗` completely.
Add `•` operator for matmul, and remove `Tensor.dot` and `⊗` completely.
Previously we deprecated
Tensor.dot
and⊗
in favor ofmatmul
for mathematical correctness and established conventions. However, a unicode operator is still nice to have and can showcase Swift's support for mathy operators. We now replace the⊗
operator with bullet•
, which would naturally read "dot" in a math context.•
is also easy to type: it is⌥8
on a Mac.Relevant discussions:
Note: The semantics of tensor contraction (
tf.tensordot
) would be a better fit for operator•
thanmatmul
. We will switch the underlying semantics of•
totensordot
when it's implemented. This won't be source-breaking becausetensordot
is equivalent tomatmul
when both operands are 2D matrices.