Skip to content

Commit f909dd6

Browse files
committed
better documentation
1 parent d1c3c07 commit f909dd6

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

onnx_diagnostic/helpers/helper.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,30 @@ def string_type(
112112
:param verbose: verbosity (to show the path it followed to get that print)
113113
:return: str
114114
115+
The function displays something like the following for a tensor.
116+
117+
.. code-block:: text
118+
119+
T7s2x7[0.5:6:A3.56]
120+
^^^+-^^----+------^
121+
|| | |
122+
|| | +-- information about the content of a tensor or array
123+
|| | [min,max:A<average>]
124+
|| |
125+
|| +-- a shape
126+
||
127+
|+-- integer following the code defined by onnx.TensorProto,
128+
| 7 is onnx.TensorProto.INT64 (see onnx_dtype_name)
129+
|
130+
+-- A,T,F
131+
A is an array from numpy
132+
T is a Tensor from pytorch
133+
F is a FakeTensor from pytorch
134+
135+
The element types for a tensor are displayed as integer to shorten the message.
136+
The semantic is defined by :class:`onnx.TensorProto` and can be obtained
137+
by :func:`onnx_dtype_name`.
138+
115139
.. runpython::
116140
:showcode:
117141

0 commit comments

Comments
 (0)