Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions tensor-shapes/pyrefly-torch-stubs/test/test_dtype_aliases.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,8 @@ def test_float_dtype_alias() -> None:
assert torch.float is torch.float32
assert isinstance(torch.float, torch.dtype)
assert_shape(torch.ones((2, 3), dtype=torch.float).shape, (2, 3))


def test_half_dtype_alias() -> None:
assert torch.half is torch.float16
assert_shape(torch.ones((2, 3), dtype=torch.half).shape, (2, 3))
1 change: 1 addition & 0 deletions tensor-shapes/pyrefly-torch-stubs/torch-stubs/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,7 @@ type _LegacyTensorScalar = builtins.bool | builtins.int | builtins.float
qint8: Any
quint8: Any
float16: Any
half: Any
float32: Any
float64: Any
int8: Any
Expand Down
Loading