tf_agents.utils.object_identity.Reference
Stay organized with collections
Save and categorize content based on your preferences.
Reference that refers an object.
tf_agents.utils.object_identity.Reference(
wrapped
)
x = [1]
y = [1]
x_ref1 = Reference(x)
x_ref2 = Reference(x)
y_ref2 = Reference(y)
print(x_ref1 == x_ref2)
==> True
print(x_ref1 == y)
==> False
Methods
deref
View source
deref()
Returns the referenced object.
x_ref = Reference(x)
print(x is x_ref.deref())
==> True
__eq__
View source
__eq__(
other
)
Return self==value.
__gt__
View source
__gt__(
other
)
Return self>value.
__lt__
View source
__lt__(
other
)
Return self<value.
__ne__
View source
__ne__(
other
)
Return self!=value.
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.Reference\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#L106-L137) |\n\nReference that refers an object. \n\n tf_agents.utils.object_identity.Reference(\n wrapped\n )\n\n x = [1]\n y = [1]\n\n x_ref1 = Reference(x)\n x_ref2 = Reference(x)\n y_ref2 = Reference(y)\n\n print(x_ref1 == x_ref2)\n ==\u003e True\n\n print(x_ref1 == y)\n ==\u003e False\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Attributes ---------- ||\n|-------------|---------------|\n| `unwrapped` | \u003cbr /\u003e \u003cbr /\u003e |\n\n\u003cbr /\u003e\n\nMethods\n-------\n\n### `deref`\n\n[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/utils/object_identity.py#L128-L137) \n\n deref()\n\nReturns the referenced object. \n\n x_ref = Reference(x)\n print(x is x_ref.deref())\n ==\u003e True\n\n### `__eq__`\n\n[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/utils/object_identity.py#L77-L81) \n\n __eq__(\n other\n )\n\nReturn self==value.\n\n### `__gt__`\n\n[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/utils/object_identity.py#L73-L75) \n\n __gt__(\n other\n )\n\nReturn self\\\u003evalue.\n\n### `__lt__`\n\n[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/utils/object_identity.py#L69-L71) \n\n __lt__(\n other\n )\n\nReturn self\\\u003cvalue.\n\n### `__ne__`\n\n[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/utils/object_identity.py#L83-L84) \n\n __ne__(\n other\n )\n\nReturn self!=value."]]