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

add mseloss module #5116

Merged
merged 18 commits into from
Jun 8, 2021
Merged

add mseloss module #5116

merged 18 commits into from
Jun 8, 2021

Conversation

YongtaoShi
Copy link
Contributor

@YongtaoShi YongtaoShi commented Jun 7, 2021

image

@YongtaoShi
Copy link
Contributor Author

@doombeaker @Flowingsun007 @BBuf
mseloss帮忙review下哈

@BBuf BBuf added the interface label Jun 7, 2021
@YongtaoShi YongtaoShi linked an issue Jun 7, 2021 that may be closed by this pull request
"none",
"mean",
None,
], "only 'sum', 'mean' and None supported by now"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里修改一下,类似于reduction parameter only support 'sum'/'mean'/'none'/None value now!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

test_case.assertTrue(np.allclose(input.grad.numpy(), np_grad, 1e-5, 1e-5))


def _test_mseloss_one_elem_input_backward(test_case, device, reduction):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

既然numpy实现了forward和backward,那么这些测试样例都可以合并,通过设置shape来统一测试。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

}


def _test_mseloss_backward(test_case, device, shape, reduction):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

名字改成_test_mseloss_impl

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot June 8, 2021 03:08
@oneflow-ci-bot oneflow-ci-bot self-requested a review June 8, 2021 04:57
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot June 8, 2021 10:02
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot June 8, 2021 10:43
@oneflow-ci-bot oneflow-ci-bot removed their request for review June 8, 2021 11:02
@oneflow-ci-bot oneflow-ci-bot self-requested a review June 8, 2021 11:48
@oneflow-ci-bot oneflow-ci-bot merged commit 5da25cf into master Jun 8, 2021
@oneflow-ci-bot oneflow-ci-bot deleted the shiyongtao/dev_mseloss branch June 8, 2021 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants