summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Glisse <marc.glisse@inria.fr>2022-11-18 20:22:50 +0100
committerMarc Glisse <marc.glisse@inria.fr>2022-11-18 20:22:50 +0100
commitdd07d34e91cdfecd539ddc6afa22992fa12d38c6 (patch)
treec41c50af407462624fb7ad3745dff5b2ce6ce36a
parent59f971d72003b358591f6ae1686823d43ee925fe (diff)
Reset print precision after this example
otherwise it also affects other random examples
-rw-r--r--src/python/doc/representations.rst14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/python/doc/representations.rst b/src/python/doc/representations.rst
index 7eede2df..37d3aa53 100644
--- a/src/python/doc/representations.rst
+++ b/src/python/doc/representations.rst
@@ -52,7 +52,12 @@ This small example is also provided
PersLay
^^^^^^^
-.. testcode::
+.. testsetup:: perslay
+
+ import numpy
+ numpy.set_printoptions(precision=5)
+
+.. testcode:: perslay
import numpy as np
import tensorflow as tf
@@ -71,10 +76,13 @@ PersLay
perslay = gdtf.Perslay(phi=phi, weight=weight, perm_op=perm_op, rho=rho)
vectors = perslay(diagrams)
- np.set_printoptions(precision=5)
print(vectors)
-.. testoutput::
+.. testcleanup:: perslay
+
+ numpy.set_printoptions(precision=8)
+
+.. testoutput:: perslay
tf.Tensor(
[[[[1.72661e-16]