Skip to content

Commit 9c79ee8

Browse files
authored
PEP 646: Add explicit section on endorsements (GH-2055)
1 parent 33a8e4a commit 9c79ee8

File tree

1 file changed

+68
-2
lines changed

1 file changed

+68
-2
lines changed

pep-0646.rst

+68-2
Original file line numberDiff line numberDiff line change
@@ -1184,6 +1184,68 @@ Footnotes
11841184
shape begins with 'time × batch', then ``videos_batch[1][0]`` would select the
11851185
same frame.
11861186
1187+
Endorsements
1188+
============
1189+
1190+
Variadic generics have a wide range of uses. For the fraction of that range
1191+
involving numerical computing, how likely is it that relevant libraries will
1192+
actually make use of the features proposed in this PEP?
1193+
1194+
We reached out to a number of people with this question, and received the
1195+
following endorsements.
1196+
1197+
From **Stephan Hoyer**, member of the NumPy Steering Council:
1198+
[#stephan-endorsement]_
1199+
1200+
I just wanted to thank Matthew & Pradeep for writing this PEP and for
1201+
clarifications to the broader context of PEP 646 for array typing in
1202+
https://github.com/python/peps/pull/1904.
1203+
1204+
As someone who is heavily involved in the Python numerical computing
1205+
community (e.g., NumPy, JAX, Xarray), but who is not so familiar with the
1206+
details of Python's type system, it is reassuring to see that a broad range
1207+
of use-cases related to type checking of named axes & shapes have been
1208+
considered, and could build upon the infrastructure in this PEP.
1209+
1210+
Type checking for shapes is something the NumPy community is very
1211+
interested in -- there are more thumbs up on the relevant issue on NumPy's
1212+
GitHub than any others (https://github.com/numpy/numpy/issues/7370) and we
1213+
recently added a "typing" module that is under active development.
1214+
1215+
It will certainly require experimentation to figure out the best ways to
1216+
use type checking for ndarrays, but this PEP looks like an excellent
1217+
foundation for such work.
1218+
1219+
From **Bas van Beek**, who has worked on preliminary support for
1220+
shape-generics in NumPy:
1221+
1222+
I very much share Stephan's opinion here and look forward to integrating the
1223+
new PEP 646 variadics into numpy.
1224+
1225+
In the context of numpy (and tensor typing general): the typing of array
1226+
shapes is a fairly complicated subject and the introduction of variadics
1227+
will likely play in big role in laying its foundation, as it allows for the
1228+
expression of both dimensioability as well as basic shape manipulation.
1229+
1230+
All in all, I'm very interested in where both PEP 646 and future PEPs will
1231+
take us and look forward to further developments.
1232+
1233+
From **Dan Moldovan**, a Senior Software Engineer on the TensorFlow Dev Team
1234+
and author of the TensorFlow RFC, `TensorFlow Canonical Type System`_: [#dan-endorsement]_
1235+
1236+
I'd be interested in using this the mechanisms defined in this PEP to define
1237+
rank-generic Tensor types in TensorFlow, which are important in specifying
1238+
``tf.function`` signatures in a Pythonic way, using type annotations (rather
1239+
than the custom ``input_signature`` mechanism we have today - see this
1240+
issue: https://github.com/tensorflow/tensorflow/issues/31579). Variadic
1241+
generics are among the last few missing pieces to create an elegant set of
1242+
type definitions for tensors and shapes.
1243+
1244+
(For the sake of transparency - we also reached out to folks from a third popular
1245+
numerical computing library, PyTorch, but did *not* receive a statement of
1246+
endorsement from them. Our understanding is that although they are interested
1247+
in some of the same issues - e.g. static shape inference - they are currently
1248+
focusing on enabling this through a DSL rather than the Python type system.)
11871249

11881250
Acknowledgements
11891251
================
@@ -1193,7 +1255,7 @@ Thank you to **Alfonso Castaño**, **Antoine Pitrou**, **Bas v.B.**, **David Fos
11931255
**Sergei Lebedev**, and **Vladimir Mikulik** for helpful feedback and suggestions on
11941256
drafts of this PEP.
11951257

1196-
Thank you especially to **Lucio** for suggesting the star syntax (which has made multiple aspects of this proposal much more concise and intuitive), and to **Stephan Hoyer** for his kind `endorsement`_ of the PEP on the python-dev mailing list.
1258+
Thank you especially to **Lucio** for suggesting the star syntax (which has made multiple aspects of this proposal much more concise and intuitive), and to **Stephan Hoyer** and **Dan Moldovan** for their endorsements.
11971259

11981260
Resources
11991261
=========
@@ -1246,7 +1308,11 @@ References
12461308

12471309
.. _this exercise: https://spinningup.openai.com/en/latest/spinningup/exercise2_2_soln.html
12481310

1249-
.. _endorsement: https://mail.python.org/archives/list/[email protected]/message/UDM7Y6HLHQBKXQEBIBD5ZLB5XNPDZDXV/
1311+
.. _TensorFlow Canonical Type System: https://github.com/tensorflow/community/pull/208
1312+
1313+
.. [#stephan-endorsement] https://mail.python.org/archives/list/[email protected]/message/UDM7Y6HLHQBKXQEBIBD5ZLB5XNPDZDXV/
1314+
1315+
.. [#dan-endorsement] https://mail.python.org/archives/list/[email protected]/message/HTCARTYYCHETAMHB6OVRNR5EW5T2CP4J/
12501316
12511317
Copyright
12521318
=========

0 commit comments

Comments
 (0)