tf_agents.utils.nest_utils.assert_matching_dtypes_and_inner_shapes
Stay organized with collections
Save and categorize content based on your preferences.
Returns True
if tensors and specs have matching dtypes and inner shapes.
tf_agents.utils.nest_utils.assert_matching_dtypes_and_inner_shapes(
tensors_or_specs,
specs,
caller,
tensors_name,
specs_name,
allow_extra_fields=False
)
Args |
tensors_or_specs
|
A nest of Tensor like or tf.TypeSpec objects.
|
specs
|
A nest of tf.TypeSpec objects.
|
caller
|
The object calling assert... .
|
tensors_name
|
(str) Name to use for the tensors in case of an error.
|
specs_name
|
(str) Name to use for the specs in case of an error.
|
allow_extra_fields
|
If True , then tensors may contain more keys or list
fields than strictly required by specs .
|
Raises |
ValueError
|
If the tensors do not match the specs' dtypes or their inner
shapes do not match the specs' shapes.
|
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."],[],[]]