From 71e7ffe2c0d790dac28732229aaa91f79927621c Mon Sep 17 00:00:00 2001 From: 0xzhang <33616362+0xzhang@users.noreply.github.com> Date: Fri, 29 Apr 2022 21:01:56 +0800 Subject: [PATCH] fix tests --- tests/python/test_api.py | 18 +++++++++--------- tests/python/test_get_external_tensor_shape.py | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/python/test_api.py b/tests/python/test_api.py index 1003e067b0389e..df555dc01512bd 100644 --- a/tests/python/test_api.py +++ b/tests/python/test_api.py @@ -60,8 +60,8 @@ def _get_expected_matrix_apis(): 'wasm', 'x64', 'x86_64', 'zero' ] user_api[ti.Field] = [ - 'copy_from', 'dtype', 'fill', 'from_numpy', 'from_torch', 'from_paddle', - 'parent', 'shape', 'snode', 'to_numpy', 'to_torch', 'to_paddle' + 'copy_from', 'dtype', 'fill', 'from_numpy', 'from_paddle', 'from_torch', + 'parent', 'shape', 'snode', 'to_numpy', 'to_paddle', 'to_torch' ] user_api[ti.FieldsBuilder] = [ 'bit_array', 'bit_struct', 'bitmasked', 'deactivate_all', 'dense', @@ -77,9 +77,9 @@ def _get_expected_matrix_apis(): ] user_api[ti.Matrix] = _get_expected_matrix_apis() user_api[ti.MatrixField] = [ - 'copy_from', 'dtype', 'fill', 'from_numpy', 'from_torch', 'from_paddle', - 'get_scalar_field', 'parent', 'shape', 'snode', 'to_numpy', 'to_torch', - 'to_paddle' + 'copy_from', 'dtype', 'fill', 'from_numpy', 'from_paddle', 'from_torch', + 'get_scalar_field', 'parent', 'shape', 'snode', 'to_numpy', 'to_paddle', + 'to_torch' ] user_api[ti.MatrixNdarray] = [ 'copy_from', 'element_shape', 'fill', 'from_numpy', 'to_numpy' @@ -90,17 +90,17 @@ def _get_expected_matrix_apis(): 'dynamic', 'lazy_grad', 'parent', 'place', 'pointer', 'shape' ] user_api[ti.ScalarField] = [ - 'copy_from', 'dtype', 'fill', 'from_numpy', 'from_torch', 'from_paddle', - 'parent', 'shape', 'snode', 'to_numpy', 'to_torch', 'to_paddle' + 'copy_from', 'dtype', 'fill', 'from_numpy', 'from_paddle', 'from_torch', + 'parent', 'shape', 'snode', 'to_numpy', 'to_paddle', 'to_torch' ] user_api[ti.ScalarNdarray] = [ 'copy_from', 'element_shape', 'fill', 'from_numpy', 'to_numpy' ] user_api[ti.Struct] = ['field', 'fill', 'items', 'keys', 'to_dict'] user_api[ti.StructField] = [ - 'copy_from', 'dtype', 'fill', 'from_numpy', 'from_torch', 'from_paddle', + 'copy_from', 'dtype', 'fill', 'from_numpy', 'from_paddle', 'from_torch', 'get_member_field', 'keys', 'parent', 'shape', 'snode', 'to_numpy', - 'to_torch', 'to_paddle' + 'to_paddle', 'to_torch' ] user_api[ti.VectorNdarray] = [ 'copy_from', 'element_shape', 'fill', 'from_numpy', 'to_numpy' diff --git a/tests/python/test_get_external_tensor_shape.py b/tests/python/test_get_external_tensor_shape.py index 44b8dc31c3d0ff..a4f90c48e22ba7 100644 --- a/tests/python/test_get_external_tensor_shape.py +++ b/tests/python/test_get_external_tensor_shape.py @@ -78,7 +78,7 @@ def func(x: ti.types.ndarray(), index: ti.template()) -> ti.i32: @pytest.mark.skipif(not has_paddle(), reason='PaddlePaddle not installed.') @pytest.mark.parametrize('size', [[1, 2, 3, 4]]) @test_utils.test(exclude=ti.opengl) -def test_get_external_tensor_shape_access_torch(size): +def test_get_external_tensor_shape_access_paddle(size): @ti.kernel def func(x: ti.types.ndarray(), index: ti.template()) -> ti.i32: return x.shape[index]