ModelProfile 类
构造函数
ModelProfile(workspace, name)
参数
名称 | 说明 |
---|---|
workspace
必需
|
包含模型的工作区对象。 |
name
必需
|
要创建和检索的配置文件的名称。 |
workspace
必需
|
包含模型的工作区对象。 |
name
必需
|
要创建和检索的配置文件的名称。 |
注解
以下示例演示如何返回 ModelProfile 对象。
profile = Model.profile(ws, "profilename", [model], inference_config, input_dataset=dataset)
profile.wait_for_profiling(True)
profiling_details = profile.get_details()
print(profiling_details)
方法
get_details |
获取分析结果的详细信息。 返回观察到的指标(各种延迟百分位、最大利用率 CPU 和内存等)以及建议的资源要求(如果成功)。 |
serialize |
将此配置文件转换为 JSON 序列化字典。 |
wait_for_completion |
等待模型完成分析。 |
get_details
serialize
wait_for_completion
等待模型完成分析。
wait_for_completion(show_output=False)
参数
名称 | 说明 |
---|---|
show_output
|
用于打印更详细输出的布尔选项。 默认为 False。 默认值: False
|