mlx.core.export_to_dot

Contents

mlx.core.export_to_dot#

export_to_dot(file: object, *args, **kwargs) None#

Export a graph to DOT format for visualization.

A variable number of output arrays can be provided for exporting The graph exported will recursively include all unevaluated inputs of the provided outputs.

Parameters:
  • file (str) – The file path to export to.

  • *args (array) – The output arrays.

  • **kwargs (dict[str, array]) – Provide some names for arrays in the graph to make the result easier to parse.

Example

>>> a = mx.array(1) + mx.array(2)
>>> mx.export_to_dot("graph.dot", a)
>>> x = mx.array(1)
>>> y = mx.array(2)
>>> mx.export_to_dot("graph.dot", x + y, x=x, y=y)