tf_agents.replay_buffers.table.Table
Stay organized with collections
Save and categorize content based on your preferences.
A table that can store Tensors or nested Tensors.
tf_agents.replay_buffers.table.Table(
tensor_spec, capacity, scope='Table'
)
Args |
tensor_spec
|
A nest of TensorSpec representing each value that can be
stored in the table.
|
capacity
|
Maximum number of values the table can store.
|
scope
|
Variable scope for the Table.
|
Raises |
ValueError
|
If the names in tensor_spec are empty or not unique.
|
Methods
read
View source
read(
rows, slots=None
)
Returns values for the given rows.
Args |
rows
|
A scalar/list/tensor of location(s) to read values from. If rows is
a scalar, a single value is returned without a batch dimension. If rows
is a list of integers or a rank-1 int Tensor a batch of values will be
returned with each Tensor having an extra first dimension equal to the
length of rows.
|
slots
|
Optional list/tuple/nest of slots to read from. If None, all
tensors at the given rows are retrieved and the return value has the
same structure as the tensor_spec. Otherwise, only tensors with names
matching the slots are retrieved, and the return value has the same
structure as slots.
|
Returns |
Values at given rows.
|
write
View source
write(
rows, values, slots=None
)
Returns ops for writing values at the given rows.
Args |
rows
|
A scalar/list/tensor of location(s) to write values at.
|
values
|
A nest of Tensors to write. If rows has more than one element,
values can have an extra first dimension representing the batch size.
Values must have the same structure as the tensor_spec of this class if
slots is None, otherwise it must have the same structure as slots .
|
slots
|
Optional list/tuple/nest of slots to write. If None, all tensors in
the table are updated. Otherwise, only tensors with names matching the
slots are updated.
|
Returns |
Ops for writing values at rows.
|
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.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{"lastModified": "Last updated 2024-04-26 UTC."}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-04-26 UTC."],[],[]]