PyTorchDistribution 類別
PyTorch 散發組態。
- 繼承
-
azure.ai.ml.entities._job.distribution.DistributionConfigurationPyTorchDistribution
建構函式
PyTorchDistribution(*, process_count_per_instance: int | None = None, **kwargs: Any)
僅限關鍵字的參數
名稱 | Description |
---|---|
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,
)
變數
名稱 | Description |
---|---|
type
|
指定散發的類型。 將此類別自動設定為 「pytorch」。 |