tf_agents.utils.object_identity.ObjectIdentitySet
Stay organized with collections
Save and categorize content based on your preferences.
Like the built-in set, but compares objects with "is".
tf_agents.utils.object_identity.ObjectIdentitySet(
*args
)
Methods
add
View source
add(
key
)
Add an element.
clear
View source
clear()
This is slow (creates N new iterators!) but effective.
difference
View source
difference(
items
)
discard
View source
discard(
key
)
Remove an element. Do not raise an exception if absent.
intersection
View source
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
update(
items
)
__and__
__and__(
other
)
__contains__
View source
__contains__(
key
)
__eq__
__eq__(
other
)
Return self==value.
__ge__
__ge__(
other
)
Return self>=value.
__gt__
__gt__(
other
)
Return self>value.
__iter__
View source
__iter__()
__le__
__le__(
other
)
Return self<=value.
__len__
View source
__len__()
__lt__
__lt__(
other
)
Return self<value.
__or__
__or__(
other
)
__rand__
__rand__(
other
)
__ror__
__ror__(
other
)
__rsub__
__rsub__(
other
)
__rxor__
__rxor__(
other
)
__sub__
__sub__(
other
)
__xor__
__xor__(
other
)
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-04-26 UTC.
[null,null,["Last updated 2024-04-26 UTC."],[],[],null,["# tf_agents.utils.object_identity.ObjectIdentitySet\n\n\u003cbr /\u003e\n\n|-------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/utils/object_identity.py#L194-L240) |\n\nLike the built-in set, but compares objects with \"is\". \n\n tf_agents.utils.object_identity.ObjectIdentitySet(\n *args\n )\n\nMethods\n-------\n\n### `add`\n\n[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/utils/object_identity.py#L215-L216) \n\n add(\n key\n )\n\nAdd an element.\n\n### `clear`\n\n[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/utils/object_identity.py#L221-L222) \n\n clear()\n\nThis is slow (creates N new iterators!) but effective.\n\n### `difference`\n\n[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/utils/object_identity.py#L229-L232) \n\n difference(\n items\n )\n\n### `discard`\n\n[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/utils/object_identity.py#L212-L213) \n\n discard(\n key\n )\n\nRemove an element. Do not raise an exception if absent.\n\n### `intersection`\n\n[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/utils/object_identity.py#L224-L227) \n\n intersection(\n items\n )\n\n### `isdisjoint`\n\n isdisjoint(\n other\n )\n\nReturn True if two sets have a null intersection.\n\n### `pop`\n\n pop()\n\nReturn the popped value. Raise KeyError if empty.\n\n### `remove`\n\n remove(\n value\n )\n\nRemove an element. If not a member, raise a KeyError.\n\n### `update`\n\n[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/utils/object_identity.py#L218-L219) \n\n update(\n items\n )\n\n### `__and__`\n\n __and__(\n other\n )\n\n### `__contains__`\n\n[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/utils/object_identity.py#L209-L210) \n\n __contains__(\n key\n )\n\n### `__eq__`\n\n __eq__(\n other\n )\n\nReturn self==value.\n\n### `__ge__`\n\n __ge__(\n other\n )\n\nReturn self\\\u003e=value.\n\n### `__gt__`\n\n __gt__(\n other\n )\n\nReturn self\\\u003evalue.\n\n### `__iter__`\n\n[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/utils/object_identity.py#L237-L240) \n\n __iter__()\n\n### `__le__`\n\n __le__(\n other\n )\n\nReturn self\\\u003c=value.\n\n### `__len__`\n\n[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/utils/object_identity.py#L234-L235) \n\n __len__()\n\n### `__lt__`\n\n __lt__(\n other\n )\n\nReturn self\\\u003cvalue.\n\n### `__or__`\n\n __or__(\n other\n )\n\n### `__rand__`\n\n __rand__(\n other\n )\n\n### `__ror__`\n\n __ror__(\n other\n )\n\n### `__rsub__`\n\n __rsub__(\n other\n )\n\n### `__rxor__`\n\n __rxor__(\n other\n )\n\n### `__sub__`\n\n __sub__(\n other\n )\n\n### `__xor__`\n\n __xor__(\n other\n )"]]