pyrefly-shape-extensions 1.5.0.dev1__py3-none-any.whl → 1.6.0.dev1__py3-none-any.whl

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: pyrefly-shape-extensions
3
- Version: 1.5.0.dev1
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
@@ -0,0 +1,8 @@
1
+ shape_extensions/__init__.py,sha256=nIe72XptrojFeoHj05R6Mas7iKbiU9RbrANzgJymrZA,25585
2
+ shape_extensions/dsl.py,sha256=Yz8_nLzjS2D-cNNgUoR9r2kHCa-BZTgMsU25Z_QhKm0,3580
3
+ shape_extensions/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
4
+ shape_extensions/torchscript.py,sha256=Jk8Mv3dEEPGdkH6EIaHOzc11VvGwvq-o1eDELwWpUE8,12914
5
+ pyrefly_shape_extensions-1.6.0.dev1.dist-info/METADATA,sha256=PM70Oggns_s821Hj9YRaBv_BuBX1-LieZMHGA7bIGXE,4759
6
+ pyrefly_shape_extensions-1.6.0.dev1.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
7
+ pyrefly_shape_extensions-1.6.0.dev1.dist-info/licenses/LICENSE,sha256=2m03A-0Ry-Qr0hLHJZV8mNojy_8ZmMBfpLPZdtGljpM,1088
8
+ pyrefly_shape_extensions-1.6.0.dev1.dist-info/RECORD,,
@@ -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 type_shape_dsl_function(fn: _F) -> _F:
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
- @type_shape_dsl_function
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
- @type_shape_dsl_function
692
+ @shape_transform
686
693
  def broadcast(left: IntTuple, right: IntTuple) -> IntTuple:
687
694
  spec = "(),()->()"
688
695
  shapes = _dsl.IntTuples((left, right))
@@ -1,8 +0,0 @@
1
- shape_extensions/__init__.py,sha256=4XNjrfvPqq3Wg4Jl1CEjJtxNWoZQSPJsRRNQC8jBuls,25472
2
- shape_extensions/dsl.py,sha256=Yz8_nLzjS2D-cNNgUoR9r2kHCa-BZTgMsU25Z_QhKm0,3580
3
- shape_extensions/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
4
- shape_extensions/torchscript.py,sha256=Jk8Mv3dEEPGdkH6EIaHOzc11VvGwvq-o1eDELwWpUE8,12914
5
- pyrefly_shape_extensions-1.5.0.dev1.dist-info/METADATA,sha256=0_lRPbOrqLSGKqGQgiB_mVh1B-wv_oy_sU5u8o3pwro,4601
6
- pyrefly_shape_extensions-1.5.0.dev1.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
7
- pyrefly_shape_extensions-1.5.0.dev1.dist-info/licenses/LICENSE,sha256=2m03A-0Ry-Qr0hLHJZV8mNojy_8ZmMBfpLPZdtGljpM,1088
8
- pyrefly_shape_extensions-1.5.0.dev1.dist-info/RECORD,,