Skip to content
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

Merged
merged 4 commits into from Jun 14, 2018

Conversation

rxwei
Copy link
Member

@rxwei rxwei commented Jun 13, 2018

Previously we deprecated Tensor.dot and in favor of matmul 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 than matmul. We will switch the underlying semantics of to tensordot when it's implemented. This won't be source-breaking because tensordot is equivalent to matmul when both operands are 2D matrices.

@rxwei rxwei self-assigned this Jun 13, 2018
@rxwei rxwei requested a review from lattner June 13, 2018 16:55
@rxwei
Copy link
Member Author

rxwei commented Jun 13, 2018

@swift-ci please test tensorflow

@rxwei rxwei added the tensorflow This is for "tensorflow" branch PRs. label Jun 13, 2018
rxwei referenced this pull request in tensorflow/swift Jun 13, 2018
@rxwei
Copy link
Member Author

rxwei commented Jun 13, 2018

@swift-ci please clean test tensorflow

2 similar comments
@rxwei
Copy link
Member Author

rxwei commented Jun 13, 2018

@swift-ci please clean test tensorflow

@rxwei
Copy link
Member Author

rxwei commented Jun 13, 2018

@swift-ci please clean test tensorflow

@rxwei
Copy link
Member Author

rxwei commented Jun 13, 2018

@swift-ci please test tensorflow

@rxwei
Copy link
Member Author

rxwei commented Jun 13, 2018

@swift-ci PLEASE TEST TENSORFLOW

@rxwei
Copy link
Member Author

rxwei commented Jun 13, 2018

@swift-ci please test tensorflow

@dan-zheng
Copy link
Collaborator

@swift-ci Please test tensorflow

1 similar comment
@dan-zheng
Copy link
Collaborator

@swift-ci Please test tensorflow

@rxwei
Copy link
Member Author

rxwei commented Jun 13, 2018

@swift-ci please clean test tensorflow

@rxwei
Copy link
Member Author

rxwei commented Jun 13, 2018

@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?

@rxwei
Copy link
Member Author

rxwei commented Jun 13, 2018

@swift-ci please clean test tensorflow

@rxwei
Copy link
Member Author

rxwei commented Jun 13, 2018

@swift-ci test tensorflow

@shahmishal
Copy link
Member

@rxwei If you request testing again, it will abort the previous build.

@shahmishal
Copy link
Member

@swift-ci please clean test tensorflow

@rxwei
Copy link
Member Author

rxwei commented Jun 13, 2018

@swift-ci please test tensorflow

1 similar comment
@rxwei
Copy link
Member Author

rxwei commented Jun 13, 2018

@swift-ci please test tensorflow

@rxwei
Copy link
Member Author

rxwei commented Jun 13, 2018

@swift-ci please clean test tensorflow

1 similar comment
@rxwei
Copy link
Member Author

rxwei commented Jun 13, 2018

@swift-ci please clean test tensorflow

@rxwei
Copy link
Member Author

rxwei commented Jun 13, 2018

@swift-ci please test tensorflow

@rxwei
Copy link
Member Author

rxwei commented Jun 13, 2018

@swift-ci please test tensorflow

1 similar comment
@rxwei
Copy link
Member Author

rxwei commented Jun 14, 2018

@swift-ci please test tensorflow

@rxwei
Copy link
Member Author

rxwei commented Jun 14, 2018

@swift-ci please clean test tensorflow

@rxwei rxwei merged commit 07eb4fa into apple:tensorflow Jun 14, 2018
@rxwei rxwei deleted the tensor-api branch June 14, 2018 01:48
@lattner
Copy link
Collaborator

lattner commented Jun 14, 2018

Nice, thanks!

marcrasi pushed a commit that referenced this pull request Jun 14, 2018
Add `•` operator for matmul, and remove `Tensor.dot` and `⊗` completely.
marcrasi pushed a commit to google/swift that referenced this pull request Jun 15, 2018
Add `•` operator for matmul, and remove `Tensor.dot` and `⊗` completely.
marcrasi pushed a commit that referenced this pull request Jun 22, 2018
Add `•` operator for matmul, and remove `Tensor.dot` and `⊗` completely.
marcrasi pushed a commit that referenced this pull request Jun 28, 2018
Add `•` operator for matmul, and remove `Tensor.dot` and `⊗` completely.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tensorflow This is for "tensorflow" branch PRs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants