pyrefly-shape-extensions 1.5.0.dev1__tar.gz → 1.6.0.dev1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyrefly_shape_extensions-1.5.0.dev1 → pyrefly_shape_extensions-1.6.0.dev1}/PKG-INFO +4 -1
- {pyrefly_shape_extensions-1.5.0.dev1 → pyrefly_shape_extensions-1.6.0.dev1}/README.md +3 -0
- {pyrefly_shape_extensions-1.5.0.dev1 → pyrefly_shape_extensions-1.6.0.dev1}/pyproject.toml +1 -1
- {pyrefly_shape_extensions-1.5.0.dev1 → pyrefly_shape_extensions-1.6.0.dev1}/shape_extensions/__init__.py +11 -4
- {pyrefly_shape_extensions-1.5.0.dev1 → pyrefly_shape_extensions-1.6.0.dev1}/LICENSE +0 -0
- {pyrefly_shape_extensions-1.5.0.dev1 → pyrefly_shape_extensions-1.6.0.dev1}/shape_extensions/dsl.py +0 -0
- {pyrefly_shape_extensions-1.5.0.dev1 → pyrefly_shape_extensions-1.6.0.dev1}/shape_extensions/py.typed +0 -0
- {pyrefly_shape_extensions-1.5.0.dev1 → pyrefly_shape_extensions-1.6.0.dev1}/shape_extensions/torchscript.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: pyrefly-shape-extensions
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.6.0.dev1
|
|
4
4
|
Summary: Shape typing primitives and DSL for Pyrefly tensor shape tracking
|
|
5
5
|
Project-URL: homepage, https://pyrefly.org
|
|
6
6
|
Project-URL: documentation, https://pyrefly.org/en/docs/
|
|
@@ -57,6 +57,9 @@ integer tuples and lists. A direct, unstarred list literal such as `[2, 3]`
|
|
|
57
57
|
binds `Values` to `IntTuple[2, 3]`; an existing or starred list remains gradual,
|
|
58
58
|
while a direct literal containing a non-integer is rejected.
|
|
59
59
|
|
|
60
|
+
`@shape_transform` marks a type-level shape DSL function and is a runtime no-op.
|
|
61
|
+
`type_shape_dsl_function` remains available as a backward-compatible alias.
|
|
62
|
+
|
|
60
63
|
The package is versioned in lockstep with Pyrefly.
|
|
61
64
|
|
|
62
65
|
## Portable shape annotations
|
|
@@ -21,6 +21,9 @@ integer tuples and lists. A direct, unstarred list literal such as `[2, 3]`
|
|
|
21
21
|
binds `Values` to `IntTuple[2, 3]`; an existing or starred list remains gradual,
|
|
22
22
|
while a direct literal containing a non-integer is rejected.
|
|
23
23
|
|
|
24
|
+
`@shape_transform` marks a type-level shape DSL function and is a runtime no-op.
|
|
25
|
+
`type_shape_dsl_function` remains available as a backward-compatible alias.
|
|
26
|
+
|
|
24
27
|
The package is versioned in lockstep with Pyrefly.
|
|
25
28
|
|
|
26
29
|
## Portable shape annotations
|
|
@@ -8,7 +8,7 @@ description = "Shape typing primitives and DSL for Pyrefly tensor shape tracking
|
|
|
8
8
|
readme = "README.md"
|
|
9
9
|
requires-python = ">=3.10"
|
|
10
10
|
license = { file = "LICENSE" }
|
|
11
|
-
version = "1.
|
|
11
|
+
version = "1.6.0.dev1"
|
|
12
12
|
keywords = ["typechecker", "typechecking", "shapes", "tensor", "pyrefly"]
|
|
13
13
|
classifiers = [
|
|
14
14
|
"Development Status :: 4 - Beta",
|
|
@@ -59,6 +59,7 @@ __all__ = [
|
|
|
59
59
|
"defines_assert_shape",
|
|
60
60
|
"gufunc_broadcast",
|
|
61
61
|
"index_shape",
|
|
62
|
+
"shape_transform",
|
|
62
63
|
"shape_vars",
|
|
63
64
|
"static_jaxtyping",
|
|
64
65
|
"type_shape_dsl_function",
|
|
@@ -554,12 +555,18 @@ class MapIntTuples:
|
|
|
554
555
|
_F = typing.TypeVar("_F", bound=typing.Callable)
|
|
555
556
|
|
|
556
557
|
|
|
557
|
-
def
|
|
558
|
-
"""Runtime no-op for a user-defined type-level shape DSL function.
|
|
558
|
+
def shape_transform(fn: _F) -> _F:
|
|
559
|
+
"""Runtime no-op for a user-defined type-level shape DSL function.
|
|
560
|
+
|
|
561
|
+
``type_shape_dsl_function`` is a backward-compatible alias.
|
|
562
|
+
"""
|
|
559
563
|
|
|
560
564
|
return fn
|
|
561
565
|
|
|
562
566
|
|
|
567
|
+
type_shape_dsl_function = shape_transform
|
|
568
|
+
|
|
569
|
+
|
|
563
570
|
def _shape_declaration(tokens: typing.Iterable[str]) -> typing.Callable[[_F], _F]:
|
|
564
571
|
"""Build the decorator shared by `static_jaxtyping` and `shape_vars`.
|
|
565
572
|
|
|
@@ -675,14 +682,14 @@ def shape_vars(
|
|
|
675
682
|
from . import dsl as _dsl
|
|
676
683
|
|
|
677
684
|
|
|
678
|
-
@
|
|
685
|
+
@shape_transform
|
|
679
686
|
def gufunc_broadcast(spec: str, shapes: IntTuples) -> IntTuple:
|
|
680
687
|
"""Compute the output shape described by a generalized ufunc signature."""
|
|
681
688
|
|
|
682
689
|
return _dsl._gufunc_broadcast(spec, shapes)
|
|
683
690
|
|
|
684
691
|
|
|
685
|
-
@
|
|
692
|
+
@shape_transform
|
|
686
693
|
def broadcast(left: IntTuple, right: IntTuple) -> IntTuple:
|
|
687
694
|
spec = "(),()->()"
|
|
688
695
|
shapes = _dsl.IntTuples((left, right))
|
|
File without changes
|
{pyrefly_shape_extensions-1.5.0.dev1 → pyrefly_shape_extensions-1.6.0.dev1}/shape_extensions/dsl.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|