Skip to content

Commit

Permalink
unit tests for #6315
Browse files Browse the repository at this point in the history
Signed-off-by: Wenqi Li <[email protected]>
  • Loading branch information
wyli committed Apr 11, 2023
1 parent 768964b commit 950a388
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/test_get_equivalent_dtype.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,15 @@ def test_native_type(self):
out_dtype = get_equivalent_dtype(n, type(im_dtype))
self.assertEqual(out_dtype, n)

@parameterized.expand([["float", np.float64], ["float32", np.float32], ["float64", np.float64]])
@parameterized.expand(
[
["float", np.float64],
["float32", np.float32],
["np.float32", np.float32],
["float64", np.float64],
["torch.float64", np.float64],
]
)
def test_from_string(self, dtype_str, expected_np):
expected_pt = get_equivalent_dtype(expected_np, torch.Tensor)
# numpy
Expand Down

0 comments on commit 950a388

Please sign in to comment.