mlx.core.export_to_dot

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.

参数:
  • 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.

示例

>>> 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)