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

RTH_update_op_test #5823

Merged
merged 21 commits into from
Aug 11, 2021
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
debug license and add test_equal
rentainhe committed Aug 10, 2021
commit d0eaf9a6a664fc4561c76c617acd3eb8e0a9eecb
45 changes: 45 additions & 0 deletions python/oneflow/test/modules/test_equal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
"""
Copyright 2020 The OneFlow Authors. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
import unittest
from collections import OrderedDict

import numpy as np

import oneflow as flow
from test_util import GenArgList
from automated_test_util import *

#TODO: equal的底层实现没有和pytorch对齐
@flow.unittest.skip_unless_1n1d()
class TestEqual(flow.unittest.TestCase):
@autotest()
def test_flow_equal_with_random_data(test_case):
device = random_device()
shape = random_tensor().value().shape
x = random_tensor(len(shape), *shape).to(device)
y = random_tensor(len(shape), *shape).to(device)
return torch.equal(x, y)

@autotest()
def test_flow_equal_with_same_random_data(test_case):
device = random_device()
shape = random_tensor().value().shape
x = random_tensor(len(shape), *shape).to(device)
return torch.equal(x, x)


if __name__ == "__main__":
unittest.main()
12 changes: 0 additions & 12 deletions python/oneflow/test/modules/test_expand.py
Original file line number Diff line number Diff line change
@@ -13,18 +13,6 @@
See the License for the specific language governing permissions and
limitations under the License.
"""
"""
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
import unittest
from collections import OrderedDict

13 changes: 0 additions & 13 deletions python/oneflow/test/modules/test_round.py
Original file line number Diff line number Diff line change
@@ -13,19 +13,6 @@
See the License for the specific language governing permissions and
limitations under the License.
"""
"""
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""

import unittest
from collections import OrderedDict