-
Notifications
You must be signed in to change notification settings - Fork 790
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
einsum functor #5985
einsum functor #5985
Conversation
out_shape[i] = permuted_operands[dim_last_op[i]]->dim(i); | ||
} | ||
return std::shared_ptr<Tensor>(); | ||
// TODO: need function supporting construct zeros tensor with shape |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
用 ConstantFunctor
可以吗
@@ -1049,6 +1049,10 @@ | |||
SbpList sbp_tuple, DataType dtype=None, Generator generator=None)" | |||
bind_python: True | |||
|
|||
- name: "einsum" | |||
signature: "Tensor EinSum(String einsum_formula, TensorTuple inputs)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
注意一下新版functional接口的规范,https://github.com/Oneflow-Inc/oneflow/wiki/Functional-Interface,改成下面的定义,
signature: "Tensor (String einsum_formula, TensorTuple inputs) => EinSum"
|
||
// Multiply tensors and sum out dimensions in sum_dims | ||
if (sum_dims.empty()) { | ||
result = JUST(Multiply(result, operand)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Multiply被重命名为Mul了
Is there any progress? |
我们这个einsum 的完成度怎么样,还差多少工作量,感觉爱因斯坦求和用处还挺多的,alphafold 的实现就用了 |
@Ldpe2G hi, I have already noticed your excellent pr yesterday. Nice work! |
This enables users to construct complex tensor computations given the text description in Einstein summation format.
TODO: some steps in the current implementation need new operators' support, e.g. diagonal operation for any two dimensions.