Add WEBGPU tests to CI (#1463)

* webgpu tests

* assert device is webgpu

* missed env set

* exclude failing ci tests

* ignore test file

* changed acc for adam test
This commit is contained in:
Diogo
2023-08-06 13:32:01 -04:00
committed by GitHub
parent 486a9dbfd9
commit d7d1011f1e
6 changed files with 13 additions and 8 deletions

View File

@@ -133,11 +133,14 @@ class TestBitCast(unittest.TestCase):
class TestInt32Dtype(unittest.TestCase):
def test_int32_to_np(self): _test_to_np(Tensor([1,2,3,4], dtype=dtypes.int32), np.int32, [1,2,3,4])
@unittest.skipIf(Device.DEFAULT == "WEBGPU", "webgpu does not support int64")
def test_casts_to_int32(self): _test_casts_to([1,2,3,4], source_dtypes=[dtypes.float32, dtypes.int64], target_dtype=dtypes.int32)
@unittest.skipIf(Device.DEFAULT == "WEBGPU", "webgpu does not support int64")
def test_casts_from_int32(self): _test_casts_from([1,2,3,4], source_dtype=dtypes.int32, target_dtypes=[dtypes.float32, dtypes.int64])
def test_int32_ops(self): _test_ops(a_dtype=dtypes.int32, b_dtype=dtypes.int32, target_dtype=dtypes.int32)
def test_int32_upcast_float32(self): _test_ops(a_dtype=dtypes.int32, b_dtype=dtypes.float32, target_dtype=dtypes.float32)
@unittest.skipIf(Device.DEFAULT == "WEBGPU", "webgpu does not support int64")
def test_int32_upcast_int64(self): _test_ops(a_dtype=dtypes.int32, b_dtype=dtypes.int64, target_dtype=dtypes.int64)
if __name__ == '__main__':