fly_ruler_std.runtime.graph
本页由
fr-docs-dev gen-api从源码 docstring 生成,请勿手工编辑;重新生成执行just api。
在浏览器中查看编译模型或磁盘产物的只读拓扑。
python
from fly_ruler_std.runtime import graph
graph.serve(model)公开成员
| 名称 | 类型 | 定义位置 |
|---|---|---|
GraphServer | 类 | 本页 |
serve | 函数 | 本页 |
start | 函数 | 本页 |
定义
GraphServer
python
class GraphServer(_WebServer)已启动的Graph服务,公开url、close与上下文管理。
name
python
name = 'Graph'服务日志与错误信息中的领域名称。
实现位置:packages/fly_ruler/python/fly_ruler_std/runtime/graph/server.py:12
实现位置:packages/fly_ruler/python/fly_ruler_std/runtime/graph/server.py:9
serve
python
def serve(source: GraphSource, *, host: str = '127.0.0.1', port: int = 18001, open_browser: bool = True) -> None阻塞查看模型;Ctrl+C关闭服务,不退出调用进程。
参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
source | GraphSource | — | 编译模型或磁盘产物路径。 |
host | str | '127.0.0.1' | 监听地址,默认仅本机。 |
port | int | 18001 | 监听端口,0由系统分配,固定端口冲突直接报错。 |
open_browser | bool | True | 就绪后是否打开浏览器。 |
实现位置:packages/fly_ruler/python/fly_ruler_std/runtime/graph/server.py:43
start
python
def start(source: GraphSource, *, host: str = '127.0.0.1', port: int = 0, open_browser: bool = True) -> GraphServer后台启动只读拓扑服务,就绪后返回;错误直接交给调用者。
参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
source | GraphSource | — | 编译模型或磁盘产物路径。 |
host | str | '127.0.0.1' | 监听地址,默认仅本机。 |
port | int | 0 | 监听端口,0由系统分配,固定端口冲突直接报错。 |
open_browser | bool | True | 就绪后是否打开浏览器。 |
返回
| 类型 | 说明 |
|---|---|
GraphServer | 具有url、close与上下文管理能力的就绪服务句柄。 |
实现位置:packages/fly_ruler/python/fly_ruler_std/runtime/graph/server.py:16
签名类型说明
以下别名用于解释参数与返回值,不是本包的公开导出对象。
| 内部别名 | 类型定义 |
|---|---|
GraphSource | type GraphSource = InspectableModel | ModelProgram | TargetProgram[object] | str | Path |