<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/transform/blob/v1.21.0/tensorflow_transform/beam/tft_beam_io/transform_fn_io.py#L59-L141) |

Writes a TransformFn to disk.

    tft_beam.WriteTransformFn(
        path
    )

The internal structure is a directory containing two subdirectories. The
first is 'transformed_metadata' and contains metadata of the transformed data.
The second is 'transform_fn' and contains a SavedModel representing the
transformed data.

<br />

<br />

<br />

| ## Attributes ||
|---|---|
| `label` | <br /> <br /> |

<br />

## Methods

### `annotations`

    annotations() -> dict[str, Union[bytes, str, message.Message]]

### `default_label`

    default_label()

### `default_type_hints`

    default_type_hints()

### `display_data`

    display_data()

Returns the display data associated to a pipeline component.

It should be reimplemented in pipeline components that wish to have
static display data.

<br />

<br />

<br />

| Returns ||
|---|---|
| Dict\[str, Any\]: A dictionary containing `key:value` pairs. The value might be an integer, float or string value; a :class:`DisplayDataItem` for values that have more data (e.g. short value, label, url); or a :class:`HasDisplayData` instance that has more display data that should be picked up. For example:: <br /> { 'key1': 'string_value', 'key2': 1234, 'key3': 3.14159265, 'key4': DisplayDataItem('apache.org', url='http://apache.org'), 'key5': subComponent } ||

<br />

### `expand`

[View source](https://github.com/tensorflow/transform/blob/v1.21.0/tensorflow_transform/beam/tft_beam_io/transform_fn_io.py#L79-L141)

    expand(
        transform_fn
    )

### `from_runner_api`

    @classmethod
    from_runner_api(
        proto, context
    )

### `get_resource_hints`

    get_resource_hints()

### `get_type_hints`

    get_type_hints()

Gets and/or initializes type hints for this object.

If type hints have not been set, attempts to initialize type hints in this
order:

- Using self.default_type_hints().
- Using self.**class** type hints.

### `get_windowing`

    get_windowing(
        inputs
    )

Returns the window function to be associated with transform's output.

By default most transforms just return the windowing function associated
with the input PCollection (or the first input if several).

### `infer_output_type`

    infer_output_type(
        unused_input_type
    )

### `register_urn`

    @classmethod
    register_urn(
        urn, parameter_type, constructor=None
    )

### `runner_api_requires_keyed_input`

    runner_api_requires_keyed_input()

### `to_runner_api`

    to_runner_api(
        context, has_parts=False, **extra_kwargs
    )

### `to_runner_api_parameter`

    to_runner_api_parameter(
        unused_context
    )

### `to_runner_api_pickled`

    to_runner_api_pickled(
        context
    )

### `type_check_inputs`

    type_check_inputs(
        pvalueish
    )

### `type_check_inputs_or_outputs`

    type_check_inputs_or_outputs(
        pvalueish, input_or_output
    )

### `type_check_outputs`

    type_check_outputs(
        pvalueish
    )

### `with_input_types`

    with_input_types(
        input_type_hint
    )

Annotates the input type of a :class:`PTransform` with a type-hint.

<br />

<br />

<br />

| Args ||
|---|---|
| `input_type_hint` | `type` <br /> An instance of an allowed built-in type, a custom class, or an instance of a :class:`~apache_beam.typehints.typehints.TypeConstraint`. |

<br />

<br />

<br />

<br />

| Raises ||
|---|---|
| `TypeError` | If **input_type_hint** is not a valid type-hint. See :obj:`apache_beam.typehints.typehints.validate_composite_type_param()` for further details. |

<br />

<br />

<br />

<br />

| Returns ||
|---|---|
| `PTransform` | A reference to the instance of this particular :class:`PTransform` object. This allows chaining type-hinting related methods. |

<br />

### `with_output_types`

    with_output_types(
        type_hint, **tagged_type_hints
    )

Annotates the output type of a :class:`PTransform` with a type-hint.

<br />

<br />

<br />

| Args ||
|---|---|
| `type_hint` | `type` <br /> An instance of an allowed built-in type, a custom class, or a :class:`~apache_beam.typehints.typehints.TypeConstraint`. This is the type hint for the main output. |
| `**tagged_type_hints` | Type hints for tagged outputs. Each keyword argument specifies the type for a tagged output e.g., `errors=str`. |

<br />

<br />

<br />

<br />

| Raises ||
|---|---|
| `TypeError` | If **type_hint** is not a valid type-hint. See :obj:`~apache_beam.typehints.typehints.validate_composite_type_param()` for further details. |

<br />

<br />

<br />

<br />

| Returns ||
|---|---|
| `PTransform` | A reference to the instance of this particular :class:`PTransform` object. This allows chaining type-hinting related methods. |

<br />

Example::
result = pcoll \| beam.ParDo(MyDoFn()).with_output_types(
int, # main output type
errors=str, # 'errors' tagged output type
warnings=str # 'warnings' tagged output type
).with_outputs('errors', 'warnings', main='main')

### `with_resource_hints`

    with_resource_hints(
        **kwargs
    )

Adds resource hints to the :class:`PTransform`.

Resource hints allow users to express constraints on the environment where
the transform should be executed. Interpretation of the resource hints is
defined by Beam Runners. Runners may ignore the unsupported hints.

<br />

<br />

<br />

| Args ||
|---|---|
| `**kwargs` | key-value pairs describing hints and their values. |

<br />

<br />

<br />

<br />

| Raises ||
|---|---|
| `ValueError` | if provided hints are unknown to the SDK. See :mod:`apache_beam.transforms.resources` for a list of known hints. |

<br />

<br />

<br />

<br />

| Returns ||
|---|---|
| `PTransform` | A reference to the instance of this particular :class:`PTransform` object. |

<br />

### `__or__`

    __or__(
        right
    )

Used to compose PTransforms, e.g., ptransform1 \| ptransform2.

### `__ror__`

    __ror__(
        left, label=None
    )

Used to apply this PTransform to non-PValues, e.g., a tuple.

### `__rrshift__`

    __rrshift__(
        label
    )

<br />

<br />

<br />

| ## Class Variables ||
|---|---|
| pipeline | `None` |
| side_inputs | `()` |

<br />