tf_agents.utils.common.replicate
Stay organized with collections
Save and categorize content based on your preferences.
Replicates a tensor so as to match the given outer shape.
tf_agents.utils.common.replicate(
tensor, outer_shape
)
Example:
- t = [1, 2, 3], [4, 5, 6]
- outer_shape = [2, 1]
The shape of the resulting tensor is: [2, 1, 2, 3]
and its content is: [[t], [t]]
Args |
tensor
|
A tf.Tensor.
|
outer_shape
|
Outer shape given as a 1D tensor of type list, numpy or
tf.Tensor.
|
Returns |
The replicated tensor.
|
Raises |
ValueError
|
when the outer shape is incorrect.
|
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."],[],[]]