<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/utils/object_identity.py#L194-L240) |

Like the built-in set, but compares objects with "is".

    tf_agents.utils.object_identity.ObjectIdentitySet(
        *args
    )

## Methods

### `add`

[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/utils/object_identity.py#L215-L216)

    add(
        key
    )

Add an element.

### `clear`

[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/utils/object_identity.py#L221-L222)

    clear()

This is slow (creates N new iterators!) but effective.

### `difference`

[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/utils/object_identity.py#L229-L232)

    difference(
        items
    )

### `discard`

[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/utils/object_identity.py#L212-L213)

    discard(
        key
    )

Remove an element. Do not raise an exception if absent.

### `intersection`

[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/utils/object_identity.py#L224-L227)

    intersection(
        items
    )

### `isdisjoint`

    isdisjoint(
        other
    )

Return True if two sets have a null intersection.

### `pop`

    pop()

Return the popped value. Raise KeyError if empty.

### `remove`

    remove(
        value
    )

Remove an element. If not a member, raise a KeyError.

### `update`

[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/utils/object_identity.py#L218-L219)

    update(
        items
    )

### `__and__`

    __and__(
        other
    )

### `__contains__`

[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/utils/object_identity.py#L209-L210)

    __contains__(
        key
    )

### `__eq__`

    __eq__(
        other
    )

Return self==value.

### `__ge__`

    __ge__(
        other
    )

Return self\>=value.

### `__gt__`

    __gt__(
        other
    )

Return self\>value.

### `__iter__`

[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/utils/object_identity.py#L237-L240)

    __iter__()

### `__le__`

    __le__(
        other
    )

Return self\<=value.

### `__len__`

[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/utils/object_identity.py#L234-L235)

    __len__()

### `__lt__`

    __lt__(
        other
    )

Return self\<value.

### `__or__`

    __or__(
        other
    )

Return self\|value.

### `__rand__`

    __rand__(
        other
    )

### `__ror__`

    __ror__(
        other
    )

Return self\|value.

### `__rsub__`

    __rsub__(
        other
    )

### `__rxor__`

    __rxor__(
        other
    )

### `__sub__`

    __sub__(
        other
    )

### `__xor__`

    __xor__(
        other
    )