cupy.testing.for_dtypes#

cupy.testing.for_dtypes(dtypes, name='dtype')[source]#

用于参数化 dtype 测试的装饰器。

参数:
  • dtypes (list of dtypes) – 要测试的 dtype 列表。

  • name (str) – 将指定的 dtypes 传递到的参数名。

此装饰器会向测试装置添加一个由 name 指定的关键字参数。然后,它会通过将 dtypes 的每个元素传递给指定的参数来并行运行测试装置。