Skip to content

Commit

Permalink
fix docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
phinate committed Aug 14, 2023
1 parent a4c1acb commit b48e544
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/pyhf/tensor/jax_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,10 +648,10 @@ def diagonal(self, tensor_in):
>>> pyhf.set_backend("jax")
>>> tensor = pyhf.tensorlib.astensor([[1.0, 0.0], [0.0, 1.0]])
>>> tensor
tensor([[1., 0.],
[0., 1.]])
Array([[1., 0.],
[0., 1.]], dtype=float64)
>>> pyhf.tensorlib.diagonal(tensor)
tensor([1., 1.])
Array([1., 1.], dtype=float64)
Args:
tensor_in (:obj:`tensor`): The input tensor object.
Expand Down
6 changes: 3 additions & 3 deletions src/pyhf/tensor/numpy_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -668,10 +668,10 @@ def diagonal(self, tensor_in: Tensor[T]) -> ArrayLike:
>>> pyhf.set_backend("numpy")
>>> tensor = pyhf.tensorlib.astensor([[1.0, 0.0], [0.0, 1.0]])
>>> tensor
tensor([[1., 0.],
[0., 1.]])
array([[1., 0.],
[0., 1.]])
>>> pyhf.tensorlib.diagonal(tensor)
tensor([1., 1.])
array([1., 1.])
Args:
tensor_in (:obj:`tensor`): The input tensor object.
Expand Down
7 changes: 4 additions & 3 deletions src/pyhf/tensor/tensorflow_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -752,10 +752,11 @@ def diagonal(self, tensor_in):
>>> pyhf.set_backend("tensorflow")
>>> tensor = pyhf.tensorlib.astensor([[1.0, 0.0], [0.0, 1.0]])
>>> tensor
tensor([[1., 0.],
[0., 1.]])
<tf.Tensor: shape=(2, 2), dtype=float64, numpy=
array([[1., 0.],
[0., 1.]])>
>>> pyhf.tensorlib.diagonal(tensor)
tensor([1., 1.])
<tf.Tensor: shape=(2), dtype=float64, numpy=array([1., 1.])
Args:
tensor_in (:obj:`tensor`): The input tensor object.
Expand Down

0 comments on commit b48e544

Please sign in to comment.