Skip to content
This repository was archived by the owner on Jun 8, 2023. It is now read-only.
This repository was archived by the owner on Jun 8, 2023. It is now read-only.

convert_input_tensors did not check filter_dtype_str_list when the key of function_paras["kwargs"] is tensor #92

@TuringKi

Description

@TuringKi

In python/conformance/conformance_test.py:

def convert_input_tensors(function_paras: dict, test_tag: list, nhwc_list=[], dtype_list=[], filter_dtype_str_list=[]):

...
   if isinstance(function_paras['kwargs'][para], np.ndarray):
   
   ... # do filter_dtype_str_list check:

      if filter_dtype_str_list and str(tensor.dtype) in filter_dtype_str_list:
                raise DiopiException(f"Skipped: {tensor.dtype} Tensor skipped for test")

   .. 
   if para == "tensors":
    ... 
   # there ,did not.

Maybe need fix like this:

diff --git a/python/conformance/conformance_test.py b/python/conformance/conformance_test.py
index 1ccaf23..d2015ca 100644
--- a/python/conformance/conformance_test.py
+++ b/python/conformance/conformance_test.py
@@ -52,6 +52,8 @@ def convert_input_tensors(function_paras: dict, test_tag: list, nhwc_list=[], dt
         if para == "tensors":
             tensors = function_paras['kwargs'][para]
             for idx, ele in enumerate(tensors):
+                if filter_dtype_str_list and str(ele.dtype) in filter_dtype_str_list:
+                    raise DiopiException(f"Skipped: {ele.dtype} Tensor skipped for test")
                 tensors[idx] = Tensor.from_numpy(ele)
                 if ele is not None and str(ele.dtype) not in test_tag:
                     test_tag.append(str(ele.dtype))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions