mlx.core.export_to_dot

mlx.core.export_to_dot#

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

导出图到 DOT 格式以便可视化。

可以提供可变数量的输出数组进行导出。导出的图将递归地包含所提供输出的所有未计算输入。

参数:
  • file (str) – 导出的文件路径。

  • *args (array) – 输出数组。

  • **kwargs (dict[str, array]) – 为图中的数组提供一些名称,以便结果更容易解析。

示例

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