<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/keras-team/keras/tree/v3.15.1/keras/src/ops/operation.py#L20-L442) |

#### View aliases


**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

[`tf.compat.v1.keras.Operation`](https://www.tensorflow.org/api_docs/python/tf/keras/Operation)

<br />

    tf.keras.Operation(
        name=None
    )

<br />

<br />

<br />

| ## Attributes ||
|---|---|
| `input` | Retrieves the input tensor(s) of a symbolic operation. <br /> Only returns the tensor(s) corresponding to the *first time* the operation was called. |
| `output` | Retrieves the output tensor(s) of a layer. <br /> Only returns the tensor(s) corresponding to the *first time* the operation was called. |

<br />

## Methods

### `call`

[View source](https://github.com/keras-team/keras/tree/v3.15.1/keras/src/ops/operation.py#L97-L98)

    call(
        *args, **kwargs
    )

### `compute_output_spec`

[View source](https://github.com/keras-team/keras/tree/v3.15.1/keras/src/ops/operation.py#L139-L152)

    compute_output_spec(
        *args, **kwargs
    )

### `from_config`

[View source](https://github.com/keras-team/keras/tree/v3.15.1/keras/src/ops/operation.py#L322-L362)

    @classmethod
    from_config(
        config
    )

Creates an operation from its config.

This method is the reverse of `get_config`, capable of instantiating the
same operation from the config dictionary.

> [!NOTE]
> **Note:** If you override this method, you might receive a serialized dtype config, which is a `dict`. You can deserialize it as follows:

    if "dtype" in config and isinstance(config["dtype"], dict):
        policy = dtype_policies.deserialize(config["dtype"])

<br />

<br />

<br />

| Args ||
|---|---|
| `config` | A Python dictionary, typically the output of `get_config`. |

<br />

<br />

<br />

<br />

| Returns ||
|---|---|
| An operation instance. ||

<br />

### `get_config`

[View source](https://github.com/keras-team/keras/tree/v3.15.1/keras/src/ops/operation.py#L245-L320)

    get_config()

Returns the config of the object.

An object config is a Python dictionary (serializable)
containing the information needed to re-instantiate it.

### `quantized_call`

[View source](https://github.com/keras-team/keras/tree/v3.15.1/keras/src/ops/operation.py#L100-L101)

    quantized_call(
        *args, **kwargs
    )

### `rematerialized_call`

[View source](https://github.com/keras-team/keras/tree/v3.15.1/keras/src/ops/operation.py#L103-L137)

    rematerialized_call(
        fn, *args, **kwargs
    )

Enable rematerialization dynamically for an operation's call method.

<br />

<br />

<br />

| Args ||
|---|---|
| `fn` | The original `call` or `quantized_call` method of an operation. |

<br />

<br />

<br />

<br />

| Returns ||
|---|---|
| Rematerialized method. ||

<br />

### `symbolic_call`

[View source](https://github.com/keras-team/keras/tree/v3.15.1/keras/src/ops/operation.py#L83-L95)

    symbolic_call(
        *args, **kwargs
    )

### `__call__`

[View source](https://github.com/keras-team/keras/tree/v3.15.1/keras/src/ops/operation.py#L36-L81)

    __call__(
        *args, **kwargs
    )

Call self as a function.