tf_agents.utils.numpy_storage.NumpyStorage
bookmark_borderbookmark
Stay organized with collections
Save and categorize content based on your preferences.
A class to store nested objects in a collection of numpy arrays.
tf_agents.utils.numpy_storage.NumpyStorage(
data_spec, capacity
)
If a data_spec of {'foo': ArraySpec(shape=(4,), dtype=np.uint8), 'bar':
ArraySpec(shape=(3, 7), dtype=np.float32)}
were used, then this would create
two arrays, one for the 'foo' key and one for the 'bar' key. The .get and
.set methods would return/take Python dictionaries, but break down the
component arrays before storing them.
Args |
data_spec
|
An ArraySpec or a list/tuple/nest of ArraySpecs describing a
single item that can be stored in this table.
|
capacity
|
The maximum number of items that can be stored in the buffer.
|
Raises |
ValueError
|
If data_spec is not an instance or nest of ArraySpecs.
|
Methods
get
View source
get(
idx
)
Get value stored at idx.
set
View source
set(
table_idx, value
)
Set table_idx to 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.
[[["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."],[],[]]