![]() |
A specification of the inputs, outputs and parameters for a component.
tfx.types.ComponentSpec(
**kwargs
)
Components should have a corresponding ComponentSpec inheriting from this class and must override:
- PARAMETERS (as a dict of string keys and ExecutionParameter values),
- INPUTS (as a dict of string keys and ChannelParameter values) and
- OUTPUTS (also a dict of string keys and ChannelParameter values).
Here is an example of how a ComponentSpec may be defined:
class MyCustomComponentSpec(ComponentSpec): PARAMETERS = { 'internal_option': ExecutionParameter(type=str), } INPUTS = { 'input_examples': ChannelParameter(type=standard_artifacts.Examples), } OUTPUTS = { 'output_examples': ChannelParameter(type=standard_artifacts.Examples), }
To create an instance of a subclass, call it directly with any execution parameters / inputs / outputs as kwargs. For example:
spec = MyCustomComponentSpec( internal_option='abc', input_examples=input_examples_channel, output_examples=output_examples_channel)
Args | |
---|---|
**kwargs
|
Any inputs, outputs and execution parameters for this instance of the component spec. |
Attributes | |
---|---|
PARAMETERS
|
a dict of string keys and ExecutionParameter values. |
INPUTS
|
a dict of string keys and ChannelParameter values. |
OUTPUTS
|
a dict of string keys and ChannelParameter values. |
Methods
INPUTS
INPUTS()
OUTPUTS
OUTPUTS()
PARAMETERS
PARAMETERS()
from_json_dict
@classmethod
from_json_dict( dict_data: Dict[Text, Any] ) -> Any
Convert from dictionary data to an object.
to_json_dict
to_json_dict() -> Dict[Text, Any]
Convert from an object to a JSON serializable dictionary.
__eq__
__eq__(
other
)
Return self==value.