yaourt.doc#
- yaourt.doc.demo_mlp_model(filename: str) ModelProto#
Returns a demo MLP model as an ONNX ModelProto.
- Parameters:
filename – unused, kept for API compatibility
- Returns:
an ONNX ModelProto representing a small MLP network
- yaourt.doc.draw_graph_graphviz(dot: str | ModelProto, image: str, engine: str = 'dot') str#
Draws a graph using Graphviz.
- Parameters:
dot – dot graph or ModelProto
image – output image file path
engine – dot or neato
- Returns:
Graphviz output
- yaourt.doc.get_latest_pypi_version(package_name='yet-another-onnxruntime-extensions') str#
Returns the latest published version.
- yaourt.doc.plot_dot(dot: str | ModelProto, ax: matplotlib.axis.Axis | None = None, engine: str = 'dot', figsize: Tuple[int, int] | None = None) matplotlib.axis.Axis#
Draws a dot graph into a matplotlib axis.
- Parameters:
dot – dot graph or ModelProto
ax – optional matplotlib axis; if None, a new figure and axis are created
engine – dot or neato
figsize – size of the figure if ax is None
- Returns:
matplotlib axis containing the rendered graph image
- yaourt.doc.plot_histogram(tensor: ndarray, ax: plt.axes | None = None, bins: int = 30, color: str = 'orange', alpha: float = 0.7) matplotlib.axis.Axis#
Computes the distribution for a tensor.
- yaourt.doc.plot_legend(text: str, text_bottom: str = '', color: str = 'green', fontsize: int = 15) matplotlib.axes.Axes#
Plots a graph with only text (for sphinx-gallery).
- Parameters:
text – legend
text_bottom – text at the bottom
color – color
fontsize – font size
- Returns:
axis
- yaourt.doc.plot_text(text: str, ax: plt.axes | None = None, title: str = '', fontsize: int = 6, line_color_map: dict | None = None, default_color: str = '#333333', figsize: Tuple[int, int] | None = None) matplotlib.axis.Axis#
Renders a block of text as a matplotlib figure, with optional per-line color coding based on the first character of each line.
- Parameters:
text – the text to render (newlines split into rows)
ax – optional matplotlib axis; if None a new figure and axis are created
title – optional axis title
fontsize – font size for the rendered text
line_color_map – mapping from a line’s first character to a color string (e.g.
{"+": "green", "-": "red", "@": "blue"}). Lines whose first character is not in the map use default_color.default_color – color for lines not matched by line_color_map
figsize –
(width, height)in inches; only used when ax is None
- Returns:
the matplotlib axis
- yaourt.doc.rotate_align(ax, angle=15, align='right')#
Rotates x-label and aligns them to the right. Returns ax.
- yaourt.doc.save_fig(ax, name: str, **kwargs) matplotlib.axis.Axis#
Applies
tight_layoutand saves the figures. Returns ax.