forked from mindspore-Ecosystem/mindspore
!27459 Modifies test case for RandomChoiceWIthMask on mac
Merge pull request !27459 from huangbo/master_1209
This commit is contained in:
commit
9501257866
|
@ -13,6 +13,7 @@
|
|||
# limitations under the License.
|
||||
# ============================================================================
|
||||
|
||||
import platform
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
||||
|
@ -111,11 +112,16 @@ def test_RCWM_1D():
|
|||
np.array([1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1]).astype(np.bool))
|
||||
expect_index = np.array([[11], [0], [8], [2], [9], [7],
|
||||
[10], [15], [0], [0]]).astype(np.int32)
|
||||
expect_index_mac = np.array([[11], [7], [9], [15], [2], [10],
|
||||
[8], [0], [0], [0]]).astype(np.int32)
|
||||
expect_mask = np.array(
|
||||
[True, True, True, True, True, True, True, True, False, False])
|
||||
rcwm = RCWM_1D()
|
||||
output1, output2 = rcwm(input_tensor)
|
||||
print(output1.asnumpy())
|
||||
print(output2)
|
||||
assert np.array_equal(output1.asnumpy(), expect_index)
|
||||
if platform.system().lower() == "darwin":
|
||||
assert np.array_equal(output1.asnumpy(), expect_index_mac)
|
||||
else:
|
||||
assert np.array_equal(output1.asnumpy(), expect_index)
|
||||
assert np.array_equal(output2.asnumpy(), expect_mask)
|
||||
|
|
Loading…
Reference in New Issue