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.object
OutputPortBinding

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
Required

Name of the OutputPortBinding object, which can contain only letters, digits, and underscores.

datastore
Union[AbstractAzureStorageDatastore, AzureDataLakeDatastore]
default value: None

Datastore the PipelineData will reside on.

output_name
str
default value: None

Name of the output, if None name is used. Can contain only letters, digits, and underscores.

bind_mode
str
default value: mount

Specifies whether the producing step will use "upload" or "mount" or "hdfs" method to access the data.

path_on_compute
str
default value: None

For "upload" mode, the path the module writes the output to.

is_directory
bool
default value: None

Whether the output is a directory or single file.

overwrite
bool
default value: None

For "upload" mode, whether to overwrite existing data.

data_type
str
default value: None

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
default value: None

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
default value: None

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
default value: None

Optional. This is an internal parameter. You should be using PipelineData.as_dataset instead.

dataset_output
OutputDatasetConfig
default value: None

Optional. This is an internal parameter. You should be using OutputFileDatasetConfig intead.

name
str
Required

Name of the OutputPortBinding object, which can contain only letters, digits, and underscores.

datastore
Union[AbstractAzureStorageDatastore, AzureDataLakeDatastore]
Required

Datastore the PipelineData will reside on.

output_name
str
Required

Name of the output, if None name is used. Can only contain letters, digits, and underscores.

bind_mode
str
Required

Specifies whether the producing step will use "upload" or "mount" or "hdfs" method to access the data.

path_on_compute
str
Required

For "upload" mode, the path the module writes the output to.

is_directory
bool
Required

if output is a directory

overwrite
bool
Required

For "upload" mode, whether to overwrite existing data.

data_type
str
Required

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
Required

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
Required

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
Required

Optional. This is an internal parameter. You should be using PipelineData.as_dataset instead.

dataset_output
OutputDatasetConfig
Required

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

str

data_type

Get the type of data which will be produced.

Returns

The data type name.

Return type

str

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

Union[<xref:azureml.data.azure_storage_datastore.AbstractAzureStorageDatastore,azureml.data.azure_data_lake_datastore.AzureDataLakeDatastore>]

is_directory

Whether the output is a directory.

Returns

is_directory

Return type

name

Name of the OutputPortBinding object.

Returns

The name.

Return type

str

overwrite

For "upload" mode, indicate whether to overwrite existing data.

Returns

_overwrite

Return type

path_on_compute

For "upload" mode, the path the module writes the output to.

Returns

path_on_compute

Return type

str

pipeline_output_name

Get the name of the pipeline output corresponding to this OutputPortBinding.

Returns

The pipeline output name.

Return type

str

training_output

Get training output.

Returns

Training output

Return type