你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
PyTorchDistribution 类
PyTorch 分发配置。
- 继承
-
azure.ai.ml.entities._job.distribution.DistributionConfigurationPyTorchDistribution
构造函数
PyTorchDistribution(*, process_count_per_instance: int | None = None, **kwargs: Any)
仅限关键字的参数
名称 | 说明 |
---|---|
process_count_per_instance
|
每个节点的进程数。 |
示例
使用 PyTorchDistribution 配置 CommandComponent。
from azure.ai.ml import PyTorchDistribution
from azure.ai.ml.entities import CommandComponent
component = CommandComponent(
name="microsoftsamples_torch",
description="This is the PyTorch command component",
inputs={
"component_in_number": {"description": "A number", "type": "number", "default": 10.99},
"component_in_path": {"description": "A path", "type": "uri_folder"},
},
outputs={"component_out_path": {"type": "uri_folder"}},
command="echo Hello World & echo ${{inputs.component_in_number}} & echo ${{inputs.component_in_path}} "
"& echo ${{outputs.component_out_path}}",
environment="AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33",
distribution=PyTorchDistribution(
process_count_per_instance=2,
),
instance_count=2,
)
变量
名称 | 说明 |
---|---|
type
|
指定分布的类型。 对于此类,自动设置为“pytorch”。 |
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈