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

Fix error message #6930

Merged
merged 7 commits into from
Dec 24, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions oneflow/core/autograd/gradient_funcs/dot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ namespace one {

struct DotCaptureState : public AutoGradCaptureState {
bool x_requires_grad = false;
;
bool y_requires_grad = false;
;
size_t x_offset = 0;
size_t y_offset = 0;
};
Expand Down
1 change: 0 additions & 1 deletion oneflow/user/kernels/dot_kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ class DotKernel final : public user_op::OpKernel {
const user_op::Tensor* y = ctx->Tensor4ArgNameAndIndex("y", 0);
user_op::Tensor* out = ctx->Tensor4ArgNameAndIndex("out", 0);
int64_t n = x->shape().elem_cnt();
CHECK(n <= INT_MAX);
auto primitive = NewMatmulPrimitive(ctx);

primitive->Launch(ctx->stream(), 1, 1, n, 1, x->dptr(), y->dptr(), 0, out->mut_dptr());
Expand Down
3 changes: 2 additions & 1 deletion oneflow/user/ops/dot_op.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ REGISTER_USER_OP("dot")
.SetDataTypeInferFn([](user_op::InferContext* ctx) -> Maybe<void> {
const user_op::TensorDesc& x = ctx->InputTensorDesc("x", 0);
const user_op::TensorDesc& y = ctx->InputTensorDesc("y", 0);
CHECK_OR_RETURN(x.data_type() == y.data_type()) << "The input tensor type is different";
CHECK_OR_RETURN(x.data_type() == y.data_type())
<< "The data type of input tensors are different";
*ctx->OutputDType("out", 0) = ctx->InputDType("x", 0);
return Maybe<void>::Ok();
});
Expand Down
2 changes: 1 addition & 1 deletion python/oneflow/framework/docstr/math_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -1283,7 +1283,7 @@
The equation is:

$$
\\sum_{i=1}^{n}(x[i] * y[i])
\\sum_{i=1}^{n}(x[i] * y[i])
$$

Args:
Expand Down