Skip to content

Commit 1bd8044

Browse files
authored
Transform data dependent output shapes md to rst (#377)
1 parent ce1b5a3 commit 1bd8044

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
(data-dependent-output-shapes)=
1+
.. _data-dependent-output-shapes:
22

3-
# Data-dependent output shapes
3+
Data-dependent output shapes
4+
============================
45

56
Array libraries which build computation graphs commonly employ static analysis that relies upon known shapes. For example, JAX requires known array sizes when compiling code, in order to perform static memory allocation. Functions and operations which are value-dependent present difficulties for such libraries, as array sizes cannot be inferred ahead of time without also knowing the contents of the respective arrays.
67

78
While value-dependent functions and operations are not impossible to implement for array libraries which build computation graphs, this specification does not want to impose an undue burden on such libraries and permits omission of value-dependent operations. All other array libraries are expected, however, to implement the value-dependent operations included in this specification in order to be array specification compliant.
89

910
Value-dependent operations are demarcated in this specification using an admonition similar to the following:
1011

11-
:::{admonition} Data-dependent output shape
12-
:class: important
12+
.. admonition:: Data-dependent output shape
13+
:class: important
1314

14-
The shape of the output array for this function/operation depends on the data values in the input array; hence, array libraries which build computation graphs (e.g., JAX, Dask, etc.) may find this function/operation difficult to implement without knowing array values. Accordingly, such libraries may choose to omit this function. See {ref}`data-dependent-output-shapes` section for more details.
15-
:::
15+
The shape of the output array for this function/operation depends on the data values in the input array; hence, array libraries which build computation graphs (e.g., JAX, Dask, etc.) may find this function/operation difficult to implement without knowing array values. Accordingly, such libraries may choose to omit this function. See :ref:`data-dependent-output-shapes` section for more details.

0 commit comments

Comments
 (0)