From c49b8bd7e0e2e427765b14657a675dcd6fb45814 Mon Sep 17 00:00:00 2001 From: Mangesh Raut Date: Mon, 26 Oct 2026 02:44:04 +0530 Subject: [PATCH 1/2] fix(stubs): add torch.half dtype alias --- tensor-shapes/pyrefly-torch-stubs/test/test_dtype_aliases.py | 5 +++++ tensor-shapes/pyrefly-torch-stubs/torch-stubs/__init__.pyi | 1 + 2 files changed, 6 insertions(+) diff --git a/tensor-shapes/pyrefly-torch-stubs/test/test_dtype_aliases.py b/tensor-shapes/pyrefly-torch-stubs/test/test_dtype_aliases.py index 7ebf9f256d..9e3a390d1c 100644 --- a/tensor-shapes/pyrefly-torch-stubs/test/test_dtype_aliases.py +++ b/tensor-shapes/pyrefly-torch-stubs/test/test_dtype_aliases.py @@ -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)) diff --git a/tensor-shapes/pyrefly-torch-stubs/torch-stubs/__init__.pyi b/tensor-shapes/pyrefly-torch-stubs/torch-stubs/__init__.pyi index 32a3485e8f..7a4d55c6fd 100644 --- a/tensor-shapes/pyrefly-torch-stubs/torch-stubs/__init__.pyi +++ b/tensor-shapes/pyrefly-torch-stubs/torch-stubs/__init__.pyi @@ -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 From d9bc9710054a2fb67c3ff3b94818113ec9fe04c0 Mon Sep 17 00:00:00 2001 From: Mangesh Raut Date: Mon, 26 Oct 2026 03:41:10 +0530 Subject: [PATCH 2/2] ci: retrigger checks after unrelated macOS/Windows glean flake