OutputPortBinding Class
Defines a named output of a pipeline step.
OutputPortBinding can be used to specify the type of data which will be produced by a step and how the data will be produced. It can be used with InputPortBinding to specify that the step output is a required input of another step.
Initialize OutputPortBinding.
- Inheritance
-
builtins.objectOutputPortBinding
Constructor
OutputPortBinding(name, datastore=None, output_name=None, bind_mode='mount', path_on_compute=None, is_directory=None, overwrite=None, data_type=None, pipeline_output_name=None, training_output=None, dataset_registration=None, dataset_output=None)
Parameters
- name
- str
Name of the OutputPortBinding object, which can contain only letters, digits, and underscores.
- datastore
- Union[AbstractAzureStorageDatastore, AzureDataLakeDatastore]
Datastore the PipelineData will reside on.
- output_name
- str
Name of the output, if None name is used. Can contain only letters, digits, and underscores.
- bind_mode
- str
Specifies whether the producing step will use "upload" or "mount" or "hdfs" method to access the data.
- path_on_compute
- str
For "upload" mode, the path the module writes the output to.
- data_type
- str
Optional. Data type can be used to specify the expected type of the output and to detail how consuming steps should use the data. Can be any user-defined string.
- pipeline_output_name
- str
If provided this output will be available by using PipelineRun.get_pipeline_output(). Pipeline output names must be unique in the pipeline.
- training_output
- TrainingOutput
Defines output for training result. This is needed only for specific trainings which result in different kinds of outputs such as Metrics and Model. For example, AutoMLStep results in metrics and model. You can also define specific training iteration or metric used to get best model. For HyperDriveStep, you can also define the specific model files to be included in the output.
- dataset_registration
- DatasetRegistration
Optional. This is an internal parameter. You should be using PipelineData.as_dataset instead.
- dataset_output
- OutputDatasetConfig
Optional. This is an internal parameter. You should be using OutputFileDatasetConfig intead.
- name
- str
Name of the OutputPortBinding object, which can contain only letters, digits, and underscores.
- datastore
- Union[AbstractAzureStorageDatastore, AzureDataLakeDatastore]
Datastore the PipelineData will reside on.
- output_name
- str
Name of the output, if None name is used. Can only contain letters, digits, and underscores.
- bind_mode
- str
Specifies whether the producing step will use "upload" or "mount" or "hdfs" method to access the data.
- data_type
- str
Optional. Data type can be used to specify the expected type of the output and to detail how consuming steps should use the data. Can be any user-defined string.
- pipeline_output_name
- str
If provided this output will be available by using PipelineRun.get_pipeline_output(). Pipeline output names must be unique in the pipeline.
- training_output
- TrainingOutput
Defines output for training result. This is needed only for specific trainings which result in different kinds of outputs such as Metrics and Model. For example, AutoMLStep results in metrics and model. You can also define specific training iteration or metric used to get best model. For HyperDriveStep, you can also define the specific model files to be included in the output.
- dataset_registration
- DatasetRegistration
Optional. This is an internal parameter. You should be using PipelineData.as_dataset instead.
- dataset_output
- OutputDatasetConfig
Optional. This is an internal parameter. You should be using OutputFileDatasetConfig intead.
Remarks
OutputPortBinding can be used in a similar way as PipelineData when building a Pipeline to specify step inputs and outputs. The difference is OutputPortBinding needs to be used with InputPortBinding in order to be consumed as an input to another step.
An example to construct a Pipeline with OutputPortBinding is as follows:
from azureml.pipeline.core import OutputPortBinding, InputPortBinding, Pipeline
from azureml.pipeline.steps import PythonScriptStep
step_1_output = OutputPortBinding("output", datastore=datastore)
step_1 = PythonScriptStep(
name='process data',
script_name="process_data.py",
compute_target=compute,
arguments=["--output", step_1_output],
outputs=[step_1_output]
)
step_2_input = InputPortBinding("input", bind_object=step_1_output)
step_2 = PythonScriptStep(
name='train',
script_name="train.py",
compute_target=compute,
arguments=["--input", step_2_input],
inputs=[step_2_input]
)
pipeline = Pipeline(workspace=workspace, steps=[step_1, step_2])
This will create a Pipeline with two steps. The process step will be executed first, then after it has completed, the train step will be executed. Azure ML will provide the output produced by the process step, as described by the OutputPortBinding object, to the train step.
Attributes
bind_mode
Get the mode ("upload" or "mount" or "hdfs") the producing step will use to create the data.
Returns
The bind mode.
Return type
data_type
dataset_registration
Get the dataset registration information.
Returns
The dataset registration information.
Return type
datastore
Datastore the PipelineData will reside on.
Returns
The Datastore object.
Return type
is_directory
name
overwrite
path_on_compute
For "upload" mode, the path the module writes the output to.
Returns
path_on_compute
Return type
pipeline_output_name
Get the name of the pipeline output corresponding to this OutputPortBinding.
Returns
The pipeline output name.
Return type
training_output
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for