Skip to content

Commit c2710e9

Browse files
authored
docs: Add versionadded to new tensorlib methods (#2025)
* Add versionadded sphinx directive to transpose and percentile tensorlib methods.
1 parent 67c0b58 commit c2710e9

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

src/pyhf/tensor/jax_backend.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ def percentile(self, tensor_in, q, axis=None, interpolation="linear"):
319319
Returns:
320320
JAX ndarray: The value of the :math:`q`-th percentile of the tensor along the specified axis.
321321
322+
.. versionadded:: 0.7.0
322323
"""
323324
return jnp.percentile(tensor_in, q, axis=axis, interpolation=interpolation)
324325

@@ -618,5 +619,6 @@ def transpose(self, tensor_in):
618619
Returns:
619620
JAX ndarray: The transpose of the input tensor.
620621
622+
.. versionadded:: 0.7.0
621623
"""
622624
return tensor_in.transpose()

src/pyhf/tensor/numpy_backend.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ def percentile(
335335
Returns:
336336
NumPy ndarray: The value of the :math:`q`-th percentile of the tensor along the specified axis.
337337
338+
.. versionadded:: 0.7.0
338339
"""
339340
# see https://github.com/numpy/numpy/issues/22125
340341
return np.percentile(tensor_in, q, axis=axis, interpolation=interpolation) # type: ignore[call-overload,no-any-return]
@@ -637,5 +638,6 @@ def transpose(self, tensor_in: Tensor[T]) -> ArrayLike:
637638
Returns:
638639
:class:`numpy.ndarray`: The transpose of the input tensor.
639640
641+
.. versionadded:: 0.7.0
640642
"""
641643
return tensor_in.transpose()

src/pyhf/tensor/pytorch_backend.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ def percentile(self, tensor_in, q, axis=None, interpolation="linear"):
325325
Returns:
326326
PyTorch tensor: The value of the :math:`q`-th percentile of the tensor along the specified axis.
327327
328+
.. versionadded:: 0.7.0
328329
"""
329330
# Interpolation options not yet supported
330331
# c.f. https://github.com/pytorch/pytorch/pull/49267
@@ -621,5 +622,6 @@ def transpose(self, tensor_in):
621622
Returns:
622623
PyTorch FloatTensor: The transpose of the input tensor.
623624
625+
.. versionadded:: 0.7.0
624626
"""
625627
return tensor_in.transpose(0, 1)

src/pyhf/tensor/tensorflow_backend.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ def percentile(self, tensor_in, q, axis=None, interpolation="linear"):
346346
Returns:
347347
TensorFlow Tensor: The value of the :math:`q`-th percentile of the tensor along the specified axis.
348348
349+
.. versionadded:: 0.7.0
349350
"""
350351
return tfp.stats.percentile(
351352
tensor_in, q, axis=axis, interpolation=interpolation
@@ -718,5 +719,6 @@ def transpose(self, tensor_in):
718719
Returns:
719720
TensorFlow Tensor: The transpose of the input tensor.
720721
722+
.. versionadded:: 0.7.0
721723
"""
722724
return tf.transpose(tensor_in)

0 commit comments

Comments
 (0)